Skip to content
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

Go to Definition on includes can get stuck due to hover or documentHighlight requests that are stuck on IntelliSense updating (from document switching) #8885

Open
sean-mcmanus opened this issue Feb 18, 2022 Discussed in #8881 · 7 comments
Labels
bug Feature: Go to Definition An issue related to Go to Definition/Declaration. Language Service performance verified Bug has been reproduced
Milestone

Comments

@sean-mcmanus
Copy link
Contributor

Discussed in #8881

Originally posted by juxeii February 18, 2022
We have a very large code base.
One problem I have with Intellisense is that it reparses the active document although it has been parsed before.
Here is an example of how I cannot work in a smooth fashion:
I mark one include file A and click "Go to Definition".
The file A opens in an instant which is fine.
Now I go back to the original file from where I jumped from and browse to other include files.
Now I want to browse to file A again(no changes were made). It can take many seconds now to open the file A again.

I wonder why is that? Why is there no cache used which opens the file A again in an instant?
On the console for C/C++ I can see "idle loop: reparsing the active document".
Is there something I can do to improve the user experience here?

@sean-mcmanus sean-mcmanus added bug Language Service performance Feature: Go to Definition An issue related to Go to Definition/Declaration. labels Feb 18, 2022
@sean-mcmanus sean-mcmanus self-assigned this Feb 18, 2022
@michelleangela michelleangela added this to the Backlog milestone Feb 18, 2022
@sean-mcmanus
Copy link
Contributor Author

@juxeii If you set C_Cpp.loggingLevel to "Debug" you should notice that the logging gets stuck on hover or documentHighlight requests, which are blocked by the IntelliSense update, and that is causing us to not get the Go to Def messages. We could potentially add code to avoid the IntelliSense update parse when the active document changes and/or stop sending hover and document highlight request messages on #include lines.

@sean-mcmanus sean-mcmanus added the verified Bug has been reproduced label Feb 18, 2022
@sean-mcmanus sean-mcmanus changed the title IntelliSense: Avoid reparsing active document possible? Go to Definition on includes can get stuck due to hover or documentHighlight requests that are stuck on IntelliSense updating (from document switching) Feb 18, 2022
@juxeii
Copy link

juxeii commented Feb 18, 2022

@sean-mcmanus: Yes, I noticed there are not logger outputs while it tries to jump to the file in question.

@sean-mcmanus sean-mcmanus modified the milestones: Backlog, On Deck Feb 18, 2022
@Colengms
Copy link
Contributor

@sean-mcmanus A hang in documentHighlight could be #8717

@sean-mcmanus
Copy link
Contributor Author

sean-mcmanus commented Feb 18, 2022

@Colengms No, I'm just referring to a normal/temporary delay of document highlight due to it being (temporarily) stuck waiting for the IntelliSense update.

@simonboily
Copy link

simonboily commented Apr 23, 2023

Has there been any progress on this issue? Any work arounds? This happens even on relatively small projects, every other f12 takes between 3-5 seconds to resolve, making VSCode a no-go tool for me.

@sean-mcmanus
Copy link
Contributor Author

@simonboily Sorry, no progress yet. If you can avoid hovering or other mouse movement and do Go to Def via F12 that could help.

@sean-mcmanus sean-mcmanus removed their assignment May 8, 2023
@Kerdek
Copy link

Kerdek commented Aug 26, 2023

An extension can assume the responsibility of avoiding reparsing the document by storing the TextDocument reference in a map used to look up the parse result.

I recommend wrapping this behavior and calling it a day.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Feature: Go to Definition An issue related to Go to Definition/Declaration. Language Service performance verified Bug has been reproduced
Projects
None yet
Development

No branches or pull requests

6 participants