Skip to content

Limit link file size #393

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Mar 23, 2021

Conversation

renkun-ken
Copy link
Member

Closes #391

The main reason not to use file extension is that there are too many text file extensions so that it might not be a good idea. To keep user from following a link to a large file that might freeze the editor, we only need to avoid providing links to large files.

This PR checks file size at documentLink/resolve so that large files won't be provided links. By default, the file size limit is 16MB. User could customize it via options(languageserver.link_file_size_limit = bytes).

The reason to check file size at resolve stage is that we could let the user know that the file exists via editor text decoration (e.g. text underlined in vscode).

@renkun-ken renkun-ken requested a review from randy3k March 20, 2021 02:52
@randy3k
Copy link
Member

randy3k commented Mar 23, 2021

LGTM

@renkun-ken renkun-ken merged commit eed6f6c into REditorSupport:master Mar 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Document link should work with limited file extensions or file size
2 participants