简体   繁体   English

如何在Visual Studio Code中重置符号查找?

[英]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). 我正在具有ms-vscode.cpptools C / C ++扩展(0.10.3)的MacBook(MacOS Sierra 10.12.3)上运行Visual Studio Code 10.10.2。

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. 但是,我收到错误消息“无法打开'xxx.h':找不到文件(绝对路径名)”,其中报告的路径名很旧-我移动了文件。 If I Option-F12 on the symbol instead, I see a list including old pre-move pathanmes and new post-move ones. 如果我在符号上使用Option-F12键,则会看到一个列表,其中包括旧的移动前路径和新的移动后路径。

Clearly VSC hasn't refreshed its lookup table following my directory reorganisation, but I can't find a "force symbol table refresh" command. 显然,在目录重组后,VSC尚未刷新其查找表,但是找不到“强制符号表刷新”命令。 Is there one, or do I have to hack a cache file somewhere? 有一个,还是我必须在某个地方破解一个缓存文件?

Have a look in ~/Library/Application Support/Code/User/workspaceStorage 看看~/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. 在我的linux和Mac设置上,我在这些文件夹中找到的唯一东西是一些名为ms-vscode.cpptools子文件夹,但ms-vscode.cpptools没有其他东西。 So when I need to clear the symbols database, I just delete the workspaceStorage folder. 因此,当我需要清除符号数据库时,只需删除workspaceStorage文件夹。

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. 您可能应该检查其他扩展名中是否没有其他内容-如果有,则可以尝试删除单个ms-vscode.cpptools文件夹。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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