This problem which seems to have started from the last update (I noticed this problem on May 22, 2017). The "Go to Definition" and "Peek Definition" functionalities have stopped working. Click and hover over the symbol also does not show the symbol definition. Please refer to screenshot below.
This might be related to #743
Thanks for reporting this. The Loading... message comes from VS Code when the extension is not responding. This could be for any number of reasons, so I'll ask a few questions and we'll go from there.
I have seen a rare issue with the extension where it will crash and VS Code automatically restarts it, but does not ever successfully send it messages again. Restarting VS Code will make it start working again, but I am trying to find a way to reproduce the problem so I can debug it and fix it.
try to check this thread #667. the solution might help
The fix for #667 is included in 0.11.1. This could be some other bug in the JavaScript, but it would be a bug we haven't identified yet.
I have this problem as well. Is it possible to back up to the previous revision?
If you are persistently having this problem, we would like to help you debug through it, but we also understand that you have work to do and are trying not to get in your way. If the extension continues to be unresponsive, go to your settings and add the following: "C_Cpp.intelliSenseEngine": "Tag Parser"
. This will revert you to the previous behavior.
VS Code does not currently provide a way to install a specific version of an extension.
@bobbrow I have the same issue. Switching to the old IntelliSense engine (by adding "C_Cpp.intelliSenseEngine": "Tag Parser"
) solves the problem.
I use Windows 8.0, VSCode 1.12.2.
I do not know if it is relevant to the problem, but there is an error in the log:
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/electron-browser/workbench.main.js:29 [Extension Host] (node:7260) DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.
d.logExtensionHostMessage @ /C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/electron-browser/workbench.main.js:29
VS Code does not currently provide a way to install a specific version of an extension.
I always save old extension directory, so I can switch several versions of extension manually.
@bobbrow Answers are below.
Thanks. Unfortunately, this appears to be something else. Does the CPU usage of either process go up at all when you make edits to the file that is open or do they both stay idle?
If the CPU usage does not increase at all, it may be stuck in a deadlock somewhere. If you are able to attach to the two processes and save a mini-dump of them for us (you can drop them into this issue), that would be super helpful.
If you use VS Code's reload window command, does the extension work again or is this something that persists? Reloading the window should unload and reload the extension.
@bobbrow ,
What OS are you using?
Windows 8.0
Do you see any Microsoft.VSCode.CPP.Extension.* or Microsoft.VSCode.CPP.IntelliSense.Msvc.* processes running?
If so, what is their memory footprint?
There is only Microsoft.VSCode.CPP.Extension.exe :
Does the CPU usage of either process go up at all when you make edits to the file that is open or do they both stay idle?
Yes, it goes up when I edit code.
If you use VS Code's reload window command, does the extension work again or is this something that persists?
The problem is persistent.
Unfortunately, I'm a bit busy so I might not be able to help debugging as of this time.
To answer your questions
@sov1178, yours looks like the bug I was referring to above that I've been trying to catch in a debugger. When you reload the window, is this process terminated and replaced with a new one? What I expect to see for this bug is that the new process will spawn a Microsoft.VSCode.CPP.IntelliSense.Msvc.exe process, but then both new processes will be torn down and replaced by a single Microsoft.VSCode.CPP.Extension.exe process with a low memory footprint that doesn't respond to editor commands as it should.
@donofthenorth, If the problem is persistent and you need to get back to work, please switch back to the old IntelliSense engine by adding the "C_Cpp.intelliSenseEngine": "Tag Parser"
setting to your settings.json. Thank you for your help.
@bobbrow
When you reload the window, is this process terminated and replaced with a new one?
Yes
What I expect to see for this bug is that the new process will spawn a Microsoft.VSCode.CPP.IntelliSense.Msvc.exe process...
No, I do not see any attempts to start Microsoft.VSCode.CPP.IntelliSense.Msvc.exe process:
What do you think about the error in the log? When I switch to "Tag Parser" there are no errors in the log.
Are there any .cpp files open in the editor? Sorry, I made an assumption there. The IntelliSense process will not start unless there is a .cpp or .h file open.
@bobbrow there were several .c and .h files opened in the editor.
@sov1178 I have seen that error in the log sometimes on the VS Code Insider build, but it doesn't appear to be related. I don't see it on the regular VS Code build. Both versions of the editor generally work for me.
If you have time, you could help us debug this by attaching to the extension process when it launches. This blog post has instructions on how to set up the debugger (WinDBG or Visual Studio) to attach to a process as soon as it is launched. A note about the instructions is that they assume you have gflags.exe available (it comes with the Debugging tools for Windows), but if you don't it also tells you which registry key needs to be created.
The process that you want to attach to is Microsoft.VSCode.CPP.Extension.exe. If the process is restarting because of a crash, the debugger should break in and you could share the callstack with us. If the process is exiting normally, then that would also be good information to have since it would mean our JavaScript has a bug.
Thanks again!
Debugger output on process start:
'Microsoft.VSCode.CPP.Extension.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ntdll.dll'. Cannot find or open the PDB file.
'Microsoft.VSCode.CPP.Extension.exe' (Win32): Loaded 'C:\Windows\SysWOW64\kernel32.dll'. Cannot find or open the PDB file.
'Microsoft.VSCode.CPP.Extension.exe' (Win32): Loaded 'C:\Windows\SysWOW64\KernelBase.dll'. Cannot find or open the PDB file.
'Microsoft.VSCode.CPP.Extension.exe' (Win32): Loaded 'C:\Windows\SysWOW64\user32.dll'. Cannot find or open the PDB file.
'Microsoft.VSCode.CPP.Extension.exe' (Win32): Loaded 'C:\Windows\SysWOW64\shell32.dll'. Cannot find or open the PDB file.
'Microsoft.VSCode.CPP.Extension.exe' (Win32): Loaded 'C:\Windows\SysWOW64\oleaut32.dll'. Cannot find or open the PDB file.
'Microsoft.VSCode.CPP.Extension.exe' (Win32): Loaded 'C:\Windows\SysWOW64\advapi32.dll'. Cannot find or open the PDB file.
'Microsoft.VSCode.CPP.Extension.exe' (Win32): Loaded 'C:\Windows\SysWOW64\psapi.dll'. Cannot find or open the PDB file.
'Microsoft.VSCode.CPP.Extension.exe' (Win32): Loaded 'C:\Windows\SysWOW64\shlwapi.dll'. Cannot find or open the PDB file.
'Microsoft.VSCode.CPP.Extension.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ole32.dll'. Cannot find or open the PDB file.
'Microsoft.VSCode.CPP.Extension.exe' (Win32): Loaded 'C:\Windows\SysWOW64\gdi32.dll'. Cannot find or open the PDB file.
'Microsoft.VSCode.CPP.Extension.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcrt.dll'. Cannot find or open the PDB file.
'Microsoft.VSCode.CPP.Extension.exe' (Win32): Loaded 'C:\Windows\SysWOW64\combase.dll'. Cannot find or open the PDB file.
'Microsoft.VSCode.CPP.Extension.exe' (Win32): Loaded 'C:\Windows\SysWOW64\rpcrt4.dll'. Cannot find or open the PDB file.
'Microsoft.VSCode.CPP.Extension.exe' (Win32): Loaded 'C:\Windows\SysWOW64\sechost.dll'. Cannot find or open the PDB file.
'Microsoft.VSCode.CPP.Extension.exe' (Win32): Loaded 'C:\Windows\SysWOW64\sspicli.dll'. Cannot find or open the PDB file.
'Microsoft.VSCode.CPP.Extension.exe' (Win32): Loaded 'C:\Windows\SysWOW64\cryptbase.dll'. Cannot find or open the PDB file.
'Microsoft.VSCode.CPP.Extension.exe' (Win32): Loaded 'C:\Windows\SysWOW64\bcryptprimitives.dll'. Cannot find or open the PDB file.
'Microsoft.VSCode.CPP.Extension.exe' (Win32): Loaded 'C:\Windows\SysWOW64\imm32.dll'. Cannot find or open the PDB file.
'Microsoft.VSCode.CPP.Extension.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msctf.dll'. Cannot find or open the PDB file.
The thread 0x196c has exited with code 0 (0x0).
Microsoft.VSCode.CPP.Extension.exe has triggered a breakpoint.
and on process stop:
First-chance exception at 0x76410192 in Microsoft.VSCode.CPP.Extension.exe: Microsoft C++ exception: vscode::terminate_threads at memory location 0x02B4F91F.
First-chance exception at 0x76410192 in Microsoft.VSCode.CPP.Extension.exe: Microsoft C++ exception: vscode::terminate_threads at memory location 0x02E8FE03.
First-chance exception at 0x76410192 in Microsoft.VSCode.CPP.Extension.exe: Microsoft C++ exception: vscode::terminate_threads at memory location 0x02D4F9FB.
First-chance exception at 0x76410192 in Microsoft.VSCode.CPP.Extension.exe: Microsoft C++ exception: vscode::terminate_threads at memory location 0x02C4F873.
The thread 0x1cf4 has exited with code 0 (0x0).
The thread 0x2bc has exited with code 0 (0x0).
The thread 0x484 has exited with code 0 (0x0).
The thread 0x13e8 has exited with code 0 (0x0).
The thread 0x234c has exited with code 0 (0x0).
The thread 0x1dd0 has exited with code 0 (0x0).
The thread 0x1f14 has exited with code 0 (0x0).
The thread 0x2018 has exited with code 0 (0x0).
The program '[6544] Microsoft.VSCode.CPP.Extension.exe' has exited with code 0 (0x0).
Updated extension to 0.11.2 - it seems it works now. But as far as I understand in "Tag Parser" mode (there is no Microsoft.VSCode.CPP.IntelliSense.Msvc.exe process).
Correct. If this crash is related to the new IntelliSense engine (and it sounds like it is), you would need to set "C_Cpp.intelliSenseEngine": "Default"
in your settings.json for 0.11.2 to get the crash to happen again.
Did you happen to grab a copy of the callstack when this line happened, or was this just the initial breakpoint?
Microsoft.VSCode.CPP.Extension.exe has triggered a breakpoint.
you would need to set "C_Cpp.intelliSenseEngine": "Default"
set it to Default and tried again with 0.11.2 version - got the same output.
or was this just the initial breakpoint?
Yes, that was just an initial breakpoint.
I do not know if it will help, but I find that IntelliSens works partially (when I type it provides suggestions, BTW, the project is in plain C, not CPP):
The tooltip is provided by the new IntelliSense process which is not being launched for you, so you just get "Loading". I need to improve the logging in this section of the code so that it can give us some more information as to why the process is failing to launch.
The completion suggestions are still provided by the Tag Parser, which is in-proc.
Thank you for being willing to help me debug this.
I am running visual studio code on Linux mint 32-bit system. I have a similar problem except there is no loading message. "Peek Definition" and "Go to Definition" don't work. "Format Selection" doesn't show up.
In my home folder a text file is created when I open visual studio code. The name of the file is "�U@�Ӎ@8 (invalid encoding)".
Hope this helps to fix the bug.
@sknavilehal, we currently only release a 64-bit version of the extension for Linux.
OS: windows 10 1709.
This problem occasionally happen to me. And I had try :
@z14git It might be better to open a new issue. Can you change your loggingLevel to Information and see if it gives information on what is going wrong? Does hover work when Go to Definition fails? Does Go to Definition only fail on variables defined in certain header files?
@sean-mcmanus, I change my loggingLevel to Information now, and if this problem happen again, I will open a new issue and show the log information.
Hover not work when Go to Definition fails, just showing Loading... like donfiguerres's description.
Although I didn't check if Go to Definition fail on every variable, I think it fails on the whole project's files, cause I already open several files in the same project, and didn't see it work on any variable or function or define.
@z14git Oh, it sounds like the main process is crashing or is stuck. We are working to reduce crashes and restart correctly after a crash.
Same here. After the recent update : Go to definition / declaration / find all references , none of them are working
Ubuntu 16.04LTS
Linux 4.13.0-41-generic #46~16.04.1-Ubuntu SMP Thu May 3 10:06:43 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
Visual Studio:
Version 1.23.1
Commit d0182c3417d225529c6d5ad24b7572815d0de9ac
Date 2018-05-10T16:04:33.747Z
Shell 1.7.12
Renderer 58.0.3029.110
Node 7.9.0
Architecture x64
Mac 10.13.4
Same issue here. After around 10-15 minutes of usage Intellisense just stops working.
Activity Monitor shows process Microsoft.VSCode.CPP.Extension.darwin
that is using ~98% CPU. Sometimes it goes up to 400% (I guess it means multiple cores on a i7 Haswell process).
I am able to make Intellisense work again by Cmd + Shift + P
and selecting Reload Window
, but the CPU usage remains high.
@CorellianAle This sounds like https://github.com/Microsoft/vscode-cpptools/issues/2043 (you could attach a debugger to confirm). We plan to release an insiders with a fix.
having similar / the same issue. since a few weeks jumping to declarations / definitions would no longer work ... it looks as if it is able to find the symbols (see 01_hover) but when i try to navigate to it it'll fail (02_go)
@lmapii The symbol's definition must not be found in your browse.path setting. You can try deleting your browse.path or copying the includePath over. Are you able to get it working?
i've tried deleting the browse.path as well as adding the folder to it, didn't change. i have ${workspaceRoot} in the browse.path and until recently that was enough since the search is recursive. only for the include path i had to add all the folders "manually"
EDIT: i've deleted and re-created the workspace, seems to be running now ...
Something's not right here: A few days ago I've re-created the workspace and things were working normally. But I've experienced (regularly) that the extension breaks after some point.
What happens is that after a while it'd stop being able to follow the declarations/definitions, it's stuck "Loading", both with hover and the "busy" progress below the filename in the editor. It doesn't go away anymore so I typically relaunch VSCODE (i'm on mac), the "Discovering Files" symbol in the bottom right re-appears, works for some time but nothing happens.
The only thing I can do is delete the workspace and set it up again (in the very same way), the discovery re-runs and it'll reload all the symbols but this literally takes hours. Any way I can give you more input on that? I don't have that problem in any other language (golang for instance is still working fine).
I was having this issue ("No definition found for ...").
Resolved by reloading PHP extension pack.
I don't have the PHP extension pack installed. Right now I'm trying to disable and re-enable it for the workspace but the file discovery takes ages.
@Imapii Yeah, we had some bugs that could cause what you're seeing -- we fixed a bunch of issues in 0.17.7, we have an insiders pre-release at https://github.com/Microsoft/vscode-cpptools/releases/tag/v0.17.7-insiders , which is close to the final version we plan to ship next week.
i've installed the pre-release and set up the workspace again, i'll see what happens, thanks !
I on Ubuntu am having the same problem, adding "C_Cpp.intelliSenseEngine": "Tag Parser",
fixes the issue for me
tried the 'Tag Parser' option before too, no luck there. but the current insider release (0.17.7) is mostly working fine so far
Having this problem on MacOs and it seems intermittent (I see what is in the second screen shot above.)
I see the issue intermittently, if I use the "Go to Definition" and "Peek Definition" it keeps loading for along time (even within the same file) and eventually works, but sometimes it works immediately. I am coding in Python and using the Microsoft Python extension. I am using VSCode version 1.27.2.
@leofelipe222 This is the C++ extension page -- it sounds like you may want to file an issue with the Python extension at https://github.com/microsoft/vscode-python/issues .
@leofelipe222 This is the C++ extension page -- it sounds like you may want to file an issue with the Python extension at https://github.com/microsoft/vscode-python/issues .
Will do, thanks.
I've same problem. The version that I'm using is 1.27.2 . I have one working vs code project and any other projects ( actually opened source code folders) and newly created ones are not working. I've tried all the things you suggest but it did not worked for me.
If you are coding in Python what solved the problem for me was disabling the "Python: Jedi" feature. You can do that by going to "File -> Preferences -> Settings", search for Jedi, disable and reload. I hope this helps you.
@ozkanakgul Can you create a new issue with more repro details? Are you using the C++ extension version 0.18.1? On what OS?
@leofelipe222 I'm coding c/c++. Thank you.
@sean-mcmanus I'm not sure when it started. But ignored this for months. But I have to investigate big project and need code navigation. So I need this. Then for about 1-2 days I'm trying to solve this problem. I think as you said it is a little bit different problem from the listed ones above. Because I have one working directory. If I put new directory in to the working one, then vs code works as well. I think it is related some configuration, but I couldn't find.
I'm using windows 10. C++ extension Version 0.18.1: August 17, 2018.
Maybe you can suggest some other things before I create a new issue?
Thank you.
@ozkanakgul We try to use the includePath setting in c_cpp_properties.json, which we copy over to the (actual) browse.path setting for Go to Def. You can set C_Cpp.loggingLevel to "Debug" to see which files get parsed after doing a Reset IntelliSense Database command. "" at the end means non-recursive symbol search (so symbols in sub folders won't be found) and "*" means recursive includePath for IntelliSense, which isn't supposed to affect Go to Def currently, but it's still possible removing that could fix issues with Go to Def in certain cases.
@sean-mcmanus I've changed both include path and browse path but it did not work. Actually I'm not sure that I'm doing in right way. Because I couldn't find file named c_cpp_properties.json in file system. I just did my changes in settings files (settings.json). I've added these lines to both workspace settings and user settings. But still it does not work. Do you have any idea about what the actual problem is?
C_Cpp.default.includePath": [
"C:\\Users\\username\\Desktop\\ProjectFolder"
],
"C_Cpp.loggingLevel": "Debug",
"C_Cpp.default.browse.path":[
"C:\\Users\\username\\Desktop\\ProjectFolder"
]
@ozkanakgul We have some info at https://github.com/Microsoft/vscode-cpptools/blob/master/Documentation/Getting%20started%20with%20IntelliSense%20configuration.md . Can you look at (and/or provide) the C/C++ output window to see what paths are being used?
@sean-mcmanus Thank you for your help. I checked out output window both working vs code folder and not working one and see that working vs code folder can do action below (parses lots of file)
using Tag Parser for quick info
tag parsing file: C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2017\COMMUNITY\VC\TOOLS\MSVC\14.15.26726\INCLUDE\VCRUNTIME_STARTUP.H
..
..
while not working one is like that. (cant add any file to db -- lots of file listed)
using Tag Parser for quick info
Unable to add file to database, error = 0x8064000a: C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.17134.0\UM\REND.IDL
..
..
What is the reason of that? Any suggestion?
@ozkanakgul It sounds like the database is corrupt or another dangling Microsoft.VSCode.CPP.Extension.exe process has locked the database. Can you do a Reset IntelliSense Database command?
@sean-mcmanus I've tried to reset intellisense, but it did not work. Also I could not find Microsoft.VSCode.CPP.Extension.exe running in processes screen.
Update : After installing version 1.28.0 (system setup) all the features worked very well. I do not know what is the actual reason of this but if there is anybody who is struggling with this problem this can be a solution. Update visual studio code to 1.28.0.
I'm on 1.30.0 on Mac and still seeing this issue. Tried updated the "C_Cpp.intelliSenseEngine" setting to "Tag Parser", but that didn't fix it.
Happy to help debug if needed.
I'm on 1.30.0 on Mac and still seeing this issue. Tried updated the "C_Cpp.intelliSenseEngine" setting to "Tag Parser", but that didn't fix it.
Happy to help debug if needed.
+1
Closing this issue due to long inactivity.
Most helpful comment
I see the issue intermittently, if I use the "Go to Definition" and "Peek Definition" it keeps loading for along time (even within the same file) and eventually works, but sometimes it works immediately. I am coding in Python and using the Microsoft Python extension. I am using VSCode version 1.27.2.