简体   繁体   English

Visual Studio 2019 IntelliSense 已更改(如何获取先前的行为?)

[英]Visual Studio 2019 IntelliSense changed (how to get prior behavior?)

Since I switched to VS 2019 (from 2017) I am pretty sure I got a degraded IntelliSense experience.自从我切换到 VS 2019(从 2017 年开始)以来,我很确定我的 IntelliSense 体验有所下降。 I looked for settings under Tools -> Options... but did not find anything helpful.我在 Tools -> Options... 下寻找设置,但没有发现任何有用的东西。

The matter is this: suppose I have a variable kvp that has a property Key, I could type "key.", scroll to the "Key" property (if this is not already selected) and then type ";"问题是这样的:假设我有一个具有属性 Key 的变量 kvp,我可以输入“key.”,滚动到“Key”属性(如果尚未选择),然后输入“;” to complete the statement.完成声明。

But this does not work anymore.但这不再起作用了。 Instead it now ignores what I selected and I get相反,它现在忽略了我选择的内容,我得到了

key.;钥匙。;

The only way to get the selected property is to explicitly hit enter.获取所选属性的唯一方法是显式按 Enter。 Same when I type the first character(s) to select the desired option: when pressing;当我键入 select 所需选项的第一个字符时相同:按下时; it just leaves what I already typed and adds the;它只是留下我已经输入的内容并添加; immediately behind it, ignoring what I selected in the popup menu.紧随其后,忽略我在弹出菜单中选择的内容。

What happened and how do I get the proper behavior back?发生了什么,我该如何恢复正确的行为?

I am using the Preview version but I already had a couple of updates and it does not improve so I guess it is by design or default behavior now.我正在使用预览版,但我已经进行了几次更新,并且没有改进,所以我猜这是设计或默认行为。

Here's some of my code for Perry.这是我为 Perry 编写的一些代码。 It is just an example though, the problem (or what I regard to be a problem) occurs with any object variable.这只是一个例子,任何 object 变量都会出现问题(或我认为的问题)。

private static void AddBlockNodes(TreeNode node, IDictionary<string, Block> blocks)
{
    foreach (KeyValuePair<string, Block> kvp in blocks)
    {
        string name = kvp.Key;
        Block block = kvp.Value;

        TreeNode childNode = new TreeNode(name);
        childNode.Tag = block;

        node.Nodes.Add(childNode);
        AddBlockNodes(childNode, block.Subblocks);
    }
}

it just leaves what I already typed and adds the;它只是留下我已经输入的内容并添加; immediately behind it, ignoring what I selected in the popup menu.What happened and how do I get the proper behavior back?紧随其后,忽略我在弹出菜单中选择的内容。发生了什么以及如何恢复正确的行为?

It is quite an abnormal behavior and l have installed Visual Studio 16.6.0 Preview 2.1 and test your code in my side and it works well.这是一种非常不正常的行为,我已经安装了 Visual Studio 16.6.0 Preview 2.1 并在我这边测试了你的代码,它运行良好。

Type variable kvp.键入变量kvp. and then select property Key and it types as expected.然后是 select 属性Key ,它按预期键入。 I did not face missing property Key during the process.在此过程中,我没有遇到缺少属性Key

You can try these steps to troubleshoot your issue:您可以尝试以下步骤来解决您的问题:

Suggestion建议

1) reset all settings by Tools --> Import and Export Settings --> Reset all settings 1)通过Tools重置所有设置-> Import and Export Settings -> Reset all settings

2) close VS Instance, enter the project path and delete .vs hidden folder which stores some Intellisense settings, bin , obj folder and then restart your project again. 2)关闭 VS Instance,进入项目路径,删除.vs隐藏文件夹,其中存储了一些 Intellisense 设置, binobj文件夹,然后重新启动项目。 I wonder if you migrate an old project into VS2019 preview version, I think you should complete this step.不知道你是不是把旧项目迁移到VS2019预览版,我觉得你应该完成这一步。

3) disable any third party extensions if you have under Extensions-->Manage Extensions in case they cause this behavior. 3)禁用任何第三方扩展,如果您在扩展 - >管理扩展下,以防它们导致此行为。

4) delete all component caches under C:\Users\xxx\AppData\Local\Microsoft\VisualStudio\16.0_xxx(16.0 is VS2019)\ComponentModelCache 4)删除C:\Users\xxx\AppData\Local\Microsoft\VisualStudio\16.0_xxx(16.0 is VS2019)\ComponentModelCache下的所有组件缓存

5) try to create a new project in VS2019 Preview version and test whether this issue persists in the new platform and if it works, I think it is an issue of your project itself. 5)尝试在VS2019预览版新建一个项目,测试一下这个问题在新平台上是否依然存在,如果可以,我认为是你的项目本身的问题。 Or you can try to migrate your project into the new project.或者您可以尝试将您的项目迁移到新项目中。

Hope it could help you.希望它可以帮助你。

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

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