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 sporadically not working #4720
Comments
When using compileCommands, the browse.path may not be set correctly, so you should check to make sure all root paths to symbols are supplied in that setting. But if you're using CMake, the CMake Tools extension is recommended to get configured, which will supply the correct browse.path setting. If you run the C/C++: Log Diagnostics command, you can see info on the currently selected translation unit to see if it's using the intended configuration. Enabling debug logging can also help detect configuration erros: https://code.visualstudio.com/docs/cpp/enable-logging-cpp . |
Hi! Regarding logging: I can surely enable logging, but the question is: What should I look for? I just played around with IntelliSense and enabled logging. However I don't see anything suspicious, except one thing: When I press Ctrl+Space in a new line I see "tag parsing file: ..." in the output window. However I assumed that when using a compilecommands file I shouldn't be using the tag parser. Can you give me suggestions on what to try out and what to look for in the debug output? Thanks, |
If you're compileCommands just references files in your workspace then you shouldn't need to set the browse.path, but if you find that you're missing symbols outside of your workspace then you'll need to add those paths explicitly to your browse.path setting. "tag parsing file" is normal behavior. The IntelliSense engine uses the tag parser data for global symbol info external to the current TU. The "tag parser" intelliSenseEngine mode is when the global symbol info is the only thing used, with no IntelliSense TU info. If you see any "fail" or "disconnected" or falling back to tag parser messages in your output then that would be a problem. |
Hi! As I wrote, I don't see anything in the debug logging, no "fail" or "disconnected". The only suspicious thing was "tag parsing file". Can I get more diagnostic info if this output is indicating a problem, or if it's "normal" for my project? |
We need more info on what is failing and how to reproduce it, in particular, I'm not sure if the tag parser or IntelliSense part is failing. When the bug occurs, do you see the missing symbols in the outline view and if you add global scoped symbols that file, do the new symbols update in the Outline view? If that doesn't work, it would mean there's a tag parser failure, possibly doing a Reset IntelliSense Database might fix it. Otherwise, it would indicate there's an IntelliSense process failure -- if you manually terminate the Microsoft.VSCode.CPP.IntelliSense.Msvc process and then hover to spawn a new one, do things start working again? If so, that would indicate the IntelliSense process is getting into a broken state, perhaps after edits occur. |
Hi! |
Yes, if Go to Definition works but IntelliSense squiggles it as unknown, that means the Go to Definition result is being obtained our tag parse database but is unknown to the current TU (IntelliSense), so you're hitting some IntelliSense bug. We fixed a bunch of bugs with https://github.com/microsoft/vscode-cpptools/releases/tag/0.26.3-insiders2, so that might be worth trying. |
Hi @sean-mcmanus, I have the similar problem. I develop c++ project using remote development on a linux machine. In a same prject, some files work perfectly with IntelliSense while in some other files the IntelliSense doesn't work. In the file which IntelliSense doesn't work, tag parser seems work, because I can see symbols in the outline view and anytime I add new symbol the outline view will update properly. And the Go to Definition also work perfectly. But I can't get any suggestion when hit ctrl + space or get any error squiggle when there are some obvious syntax errors. |
@Z1Wu It sounds like your IntelliSense process is crashing. We have a fix pending for #5326 which might fix your crash issue. Downgrading to 0.26.3 would also fix your issue if you're hitting that crash (assuming you don't need any of the fixes in 0.27.0). We plan to release a 0.28.0-insiders with the fix on Monday probably. |
Hi! |
@hensz FYI, 0.27.0 does have some known crash issues in cpptools and cpptools-srv that we plan to fix in our next release. |
Type: LanguageService
Hi there!
Perhaps this is related to #4479, but since the actual visible issue is different I opened a new issue for this. Also, perhaps this is purely a configuration issue - but I don't have a clue where to look at. Also the issue occurs kind of sporadically.
At the time of writing, it works just fine at least in some files. But most of the time I don't get any suggestions, and when I press Ctrl+Space I either get only weird keywords that match by accident, or I get the "No suggestions" tooltip. In other files I nicely see members and methods of the class I'm currently dealing with, with the correct symbols and all.
I'm using VS Code on Windows with Remote Development connection via ssh to my Linux machine. Also I'm using cmake for my project, and in the VS Code C++ project I've configured compileCommands to point to a valid and recent compile_commands.json file.
Perhaps also interesting: Within one file I encounter both cases: When I press Ctrl+Space in a new line I see some of the local symbols - however not all - with the correct icon and the respective definition. When I select one of these symbols that VS Code is supposed to know, and press '.' nothing happens - and when I press Ctrl+Space again, I see "No suggestions".
So the question is: What's wrong with my setup? How can I diagnose this strange, sporadic issue?
Thanks,
Torsten
The text was updated successfully, but these errors were encountered: