visual-studio - 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;
}
}
解决方案
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...
推荐阅读
- spring - Spring 云服务器无法从 loacl 文件系统中读取
- ansible - Ansible 逻辑在某些情况下具有相同的用户 sudo 而在其他情况下正常
- amazon-redshift - 将 2 个分区文件夹合并到一个表中
- javascript - 应用程序缓存错误事件:无法将新缓存提交到存储
- java - OpenJDK 中使用的代码模板系统是什么?它是如何工作的?
- excel - 将数字 1-12 分配给另一组数字,当达到 12 时,再次从 1 开始下一个数字并继续
- javascript - 如何使用 jquery ajax 在 swiper 滑块中显示动态数据?
- html - 锚定在超出范围的整张牌上
- git - git中的工作树分支即使在合并后也显示未合并
- javascript - 为什么我的猫头鹰旋转木马不能正常工作?