-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Disable document symbol request for files over 1MB #3430
Conversation
|
Co-authored-by: Ted Thibodeau Jr <[email protected]>
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #3430 +/- ##
==========================================
+ Coverage 55.75% 55.81% +0.06%
==========================================
Files 110 110
Lines 5243 5271 +28
Branches 1426 1437 +11
==========================================
+ Hits 2923 2942 +19
- Misses 1897 1901 +4
- Partials 423 428 +5
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks great! thank you @yepitschunked !
Oops, overlooked the missing changeset comment. I will have to fix this for the release to work. |
I ran into a problem similar to #2985 with a massive schema graphql file (~2MB file). The performance was fine when the schema is not opened (e.g, hovering for type definintions and autocomplete), but the LSP was stuck at 100% as soon as I opened the schema. It looks like the language server was stuck in
getOutline
, which is called bytextDocument/documentSymbol
. I'm not sure why this is so slow, but I generally don't care about the outline in such a large file anyway, so it seems OK to disable that feature.This PR adds a configuration option
largeFileThreshold
which defaults to 1000000. At the moment, it just disables document symbols computation, but there might be other expensive operations we could disable with this option as well.I also noticed there was no logging for this LSP message, so I added it.