首页 > 解决方案 > VisualStudio IntelliSense 建议失败

问题描述

我的 IntelliSense 有问题,它让我发疯,我保持冷静 1 个月,但我再也受不了了。IntelliSense 不断提出明显不正确的建议。

假设我有一个名为“PlayerModel”的类和一个名为“playerModel”的该类型的字段/参数。

当我开始输入“玩家”时,我以某种方式期望建议列表将以字段/参数而不是类开头,同时考虑到该类显然不包含公共常量或我可能使用的任何内容。但事实并非如此,IntelliSense 每次都给我这个:

在此处输入图像描述

显然我想引用参数而不是类。

如果我需要为字段分配值,这也不起作用。

PlayerModel anotherPlayerModel = player...

还将建议类而不是该参数。所以每次我需要手动选择第二个(也是正确的)建议时。

请帮忙,我认为这应该是常识。谢谢!

这些是我的安装包详细信息:

Microsoft Visual Studio Community 2017
版本 15.8.5
VisualStudio.15.Release/15.8.5+28010.2036
Microsoft .NET Framework
版本 4.7.02556

安装版本:社区

C# Tools 2.9.0-beta8-63208-01
FormatDocumentOnSave 1.0
NuGet Package Manager 4.6.0
ProjectServicesPackage Extension 1.0
Visual Basic Tools 2.9.0-beta8-63208-01
Visual Studio Code Debug Adapter Host Package 1.0
Visual Studio Tools for Unity 3.8.0.7

这是我的PlayerModel课程:(忽略与课程结构无关的 Unity 相关内容)

using UnityEngine;
using static Constants;

public class PlayerModel : ObjectModel {

    public int userId;

    public int activeItemIndex;

    public int kills;

    public PlayerModel(int id, Vector3 position, Quaternion rotation, float hitpoints, int userId, int activeItemIndex) : base(id, ObjectType.PLAYER, position, rotation, hitpoints) {
        this.userId = userId;
        this.activeItemIndex = activeItemIndex;
    }
}

标签: visual-studiovisual-studio-2017intellisense

解决方案


Please try switching your locale--as a test--from 1026 bg-BG to 1033 en-US. So, first close all instances of Visual Studio, apply the locale change, then restart Visual Studio. I suspect that this might fix the issue. If it does then you can decide which international setting you want to continue to use...


推荐阅读