在 Visual Studio 中刷新自动完成 (IntelliSense) 数据库

Refreshing the auto complete (IntelliSense) database in Visual Studio(在 Visual Studio 中刷新自动完成 (IntelliSense) 数据库)
本文介绍了在 Visual Studio 中刷新自动完成 (IntelliSense) 数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

我注意到 Visual Studio 中的自动完成功能在项目已经达到一定的规模(在我的例子中大约有 4,100 行代码).我还注意到,一旦第三方库的数量增加(命名空间和类属性和方法不再可见),性能也会下降.

I've noticed that the auto complete feature in Visual Studio no longer works properly once my project has reached a certain size (in my case ~4,100 lines of code). I've also noticed that performance also degrades once the number of third-party libraries increases (namespaces and class attributes and methods are no longer visible).

有没有办法手动更新自动完成数据库或为现有项目创建一个新数据库?

Is there a way of manually updating the auto completion database or create a new one for an existing project?

我目前在 Visual Studio 2008 下工作,但我经历过这种情况Visual Studio 2010 中的问题.

I am currently working under Visual Studio 2008, but I have experienced this issue in Visual Studio 2010 as well.

推荐答案

对于 VS2015、2017 和 VS2019,请关闭 Visual Studio 并删除解决方案所在文件夹中的 .vs 文件夹.其中包含智能感知数据库(如果我们知道哪些文件,应该可以只删除特定于智能感知的文件).请注意,如果您删除整个文件夹,您将丢失窗口布局配置等.

For VS2015, 2017 and VS2019 close Visual Studio and delete the .vs folder in the same folder as the solution. It contains among other things the intellisense database (it should be possible to delete only the files specific to intellisense, if we knew which ones). Note that if you delete the whole folder you will lose your window layout configurations etc.

对于以前的版本,关闭 Visual Studio 并导航到您的项目文件夹.那里的 *.sdf 文件包含智能感知数据库 - 如果您删除此文件并在 Visual Studio 中重新打开您的项目,它会重建缓存.

For previous versions, close Visual Studio and navigate to your project folder. The *.sdf file there contains the intellisense database- if you delete this files and reopen your project in visual studio, it rebuilds the cache.

删除 sdf 文件为我解决了问题.

Deleting the sdf file solved the problem for me.

有时使用大型解决方案(主要是 C++ 项目)会变成慢得无法忍受.要修复它,您需要关闭解决方案并继续删除 .SDF 文件.之后它又恢复正常了,大约一周左右,直到您需要再做一次.

Sometimes working with a big solution (mainly C++ projects) becomes unbearably slow. To fix it you need to close the solution and go delete the .SDF file. After that it returns to normal again, for about a week, or so until you need to do it again.

根本原因是 SDF 文件变得碎片化,并且,根据我所做的 xperf 分析,VS 有时会做 20,000+在调试和发布之间更改时随机读取它.推杆SSD 上的 SDF 文件可以解决问题,但不是必需的.VS需要更高效地使用SDF文件而不是阻塞SDF操作,永远.

The underlying cause is that the SDF file gets fragmented and, according to xperf profiling I've done, VS will sometimes do 20,000+ random reads from it when changing between debug and release. Putting the SDF files on an SSD fixes the problem but should not be necessary. VS needs to use the SDF file more efficiently and not do blocking SDF operations, ever.

来源:https://visualstudio.uservoice.com/forums/121579-visual-studio/suggestions/2255455-fix-the-delete-sdf-file-problem

这篇关于在 Visual Studio 中刷新自动完成 (IntelliSense) 数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

相关文档推荐

How do compilers treat variable length arrays(编译器如何处理变长数组)
Deduce template argument from std::function call signature(从 std::function 调用签名推导出模板参数)
check if member exists using enable_if(使用 enable_if 检查成员是否存在)
Standard Library Containers with additional optional template parameters?(具有附加可选模板参数的标准库容器?)
Uses of a C++ Arithmetic Promotion Header(C++ 算术提升标头的使用)
Parameter pack must be at the end of the parameter list... When and why?(参数包必须位于参数列表的末尾...何时以及为什么?)