在声明C#中声明无效变量时,VSCODE语法突出显示了断裂
我正在Blazor开发,并且正在遇到无效变量和VSCODE的问题。尝试创建Razor组件参数并使其无效时,VSCODE下面的所有行停止显示正确的C#语法突出显示。
问题的人都建议在设置中设置以下内容。
"editor.semanticHighlighting.enabled": true,
"csharp.semanticHighlighting.enabled": true
遇到类似 我正在为VSCODE使用最新版本的C#/OmnishArp。
代码的相关部分如下:(虽然可能没有什么有用)
@code{
private bool isChecked = false;
[Parameter] public int? area { get; set; }
[Parameter] public double? val { get; set; }
[Parameter] public double dist { get; set; }
private void toggleChecked()
{
isChecked = !isChecked;
}
}
是否有任何已知方法来解决此问题,或者我应该以其他方式宣布无效的变量?
I'm developing in Blazor and am running into an issue with nullable variables and VSCode. When trying to create razor component parameters and make them nullable, all lines below in VSCode stop showing correct C# syntax highlighting.
People having similar issues have suggested setting the following in settings.json in VSCode:
"editor.semanticHighlighting.enabled": true,
"csharp.semanticHighlighting.enabled": true
but this doesn't appear to fix the problem for me.
I'm using the latest version of C#/Omnisharp for VSCode.
Relevant part of the code is as follows: (though it might not be that useful)
@code{
private bool isChecked = false;
[Parameter] public int? area { get; set; }
[Parameter] public double? val { get; set; }
[Parameter] public double dist { get; set; }
private void toggleChecked()
{
isChecked = !isChecked;
}
}
Is there any known way to fix this or should I be declaring nullable variables some other way perhaps?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论