简体   繁体   中英

How do I reset Symbol Lookup in Visual Studio Code?

I'm running Visual Studio Code 10.10.2 on a MacBook (MacOS Sierra 10.12.3) with the ms-vscode.cpptools C/C++ extension (0.10.3).

If I Cmd-click on a function name I usually get taken to the definition or declaration. However, I'm getting an error "Unable to open 'xxx.h': File not found (absolute pathname)" where the pathname reported is old - I moved the file. If I Option-F12 on the symbol instead, I see a list including old pre-move pathanmes and new post-move ones.

Clearly VSC hasn't refreshed its lookup table following my directory reorganisation, but I can't find a "force symbol table refresh" command. Is there one, or do I have to hack a cache file somewhere?

Have a look in ~/Library/Application Support/Code/User/workspaceStorage

There should be a bunch of folders with random filenames. On my linux and Mac setups, the only things I've found in these folders are some sub folders called ms-vscode.cpptools but nothing else. So when I need to clear the symbols database, I just delete the workspaceStorage folder.

You should probably check that there is nothing else in there from other extensions - if there is, then you could try deleting the individual ms-vscode.cpptools folders.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM