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

Intellisense stuck in "Parsing..." state. How can I debug further? #1034

Closed
prmshepherd opened this issue Sep 14, 2017 · 10 comments
Closed

Intellisense stuck in "Parsing..." state. How can I debug further? #1034

prmshepherd opened this issue Sep 14, 2017 · 10 comments

Comments

@prmshepherd
Copy link

I'm having difficulty getting Intellisense working in default mode. Currently the extension seems to be stuck in a "Parsing..." state. I've waited hours and this has not changed. Is there a way I can drill down and see logs of what the Intellisense engine is actually doing behind the scenes?

@UR3IQO
Copy link

UR3IQO commented Sep 14, 2017

Here is the same situation. After the last update Intellisense is completely unusable. There are four small logs and one large. The small logs show that something goes wrong:

Log initialized. Verbosity level = 7
handle_compile
handle_get_errors
failed to read response from server: 12
updating translation unit, range [0, 0], preparse [0]
errorSquiggles count: 0
failed to send response to client: 16

@UR3IQO
Copy link

UR3IQO commented Sep 14, 2017

I have solved the problem. It seems IntelliSense was unable to parse some GCC machine specific include files. So I have created an alternative ones with the necessary defines and arranged paths so that IntelliSense includes alternative ones, while GCC includes standard ones.

@prmshepherd
Copy link
Author

@sov1178 any hints on how you were able to determine that was the problem? :)

@sean-mcmanus
Copy link
Contributor

sean-mcmanus commented Sep 14, 2017

We have logging instructions at https://github.com/Microsoft/vscode-cpptools/blob/master/Documentation/LanguageServer/Enabling%20logging.md . Yes, the parser has a known infinite loop with certain files (see #981 ). I don't think we regressed the scenario with 0.12.4 though -- if you believe we did regress it you can try the older version at http://ms-vscode.gallery.vsassets.io/_apis/public/gallery/publisher/ms-vscode/extension/cpptools/0.12.3/assetbyname/Microsoft.VisualStudio.Services.VSIXPackage (renaming the zip to vsix and using the Install from vsix command).

@prmshepherd You can narrow down the problem by first opening your workspace without opening any files. If the parsing (red flame) goes away, then the symbol database has finished generating successfully (Tag Parsing). Then you can open a file and the IntelliSense will start -- if that gets stuck then you can tell that the source file or one of the headers up the chain caused the IntelliSense parser to get stuck. You can also look at what process is using CPU (the IntelliSense.Msvc process is the IntelliSense one).

@prmshepherd
Copy link
Author

Thanks @sean-mcmanus! Looks like Tag Parsing is good, so most like an issue somewhere in my include hierarchy. Is there any logging to capture the parser's progress through the headers? I didn't spot anything at VSCODE_CPP_LOGFILE_LEVEL=5

@UR3IQO
Copy link

UR3IQO commented Sep 14, 2017

@sean-mcmanus it seems like IntelliSense did not like some of the GCC machine dependent headers. I have made some investigations and ended up adding a long list of defines GCC declares implicitly to the c_cpp_properties.json and it seems it helped - I got IntelliSense working now :).

@sean-mcmanus
Copy link
Contributor

@prmshepherd It turns out we don't have logging for the Default IntelliSense parsing, but we could add that.

@UR3IQO
Copy link

UR3IQO commented Sep 14, 2017

@sean-mcmanus Some more information. The problem arises when IntelliSense process was not terminated correctly. It definitely not the issue #981. I do not know why it is not terminated sometimes. And I was unable to find any conditions to reproduce the problem (one IntelliSense process stays unterminated from time to time after VS Code closing). But maybe this information can be useful.

@prmshepherd
Copy link
Author

@sean-mcmanus I think adding those logs will be very useful. Even better if the progress and status of the parser could be integrated somehow into the UI itself if that is possible?

@bobbrow
Copy link
Member

bobbrow commented Jun 28, 2018

Logging is now integrated in the UI and verbosity is controlled with the C_Cpp.loggingLevel setting. If you are still experiencing trouble with the extension, please reopen this issue and share your log output with us (preferably with loggingLevel set to "Debug").

@bobbrow bobbrow closed this as completed Jun 28, 2018
@github-actions github-actions bot locked and limited conversation to collaborators Oct 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants