Intellisense在代码段中不起作用-VS Code [英] Intellisense not working in code snippets - VS Code

查看:148
本文介绍了Intellisense在代码段中不起作用-VS Code的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在VS Code中安装了C#扩展。我遇到的问题是,在使用代码段 prop 之后,Intellisense不再建议变量类型。这种情况也发生在 ctor 之类的事情上,例如,它不会自动完成类名。

I have installed the C# extension in VS Code. The problem I am having is, after using a code snippet prop, Intellisense no longer suggests variable types. This happens with other things like ctor as well, it will not autocomplete the class name, for example.

我尝试卸载/重新安装扩展程序。我也没有运气谷歌。

I have tried uninstalling/reinstalling the extension. I have Googled without luck as well.

例如,我希望Intellisense能够建议变量类型。 Intellisense不建议任何内容。

I expect for Intellisense to suggest variable types, for example. Intellisense does not suggest anything.

命中 Ctrl +。确实建议列表中的正确修补程序。

Hitting Ctrl+. does suggest the correct fix among the list.

编辑:我的项目没有project.json或* .sln文件。我使用命令行 dotnet new webapi 创建了项目。如果这是必需的,我该如何添加它或使Intellisense工作?

My project does not have a project.json or *.sln file. I created the project using the command line dotnet new webapi. If that is what is required, how do I add it or get Intellisense working?

推荐答案

默认情况下,智能/快速建议会不在片段内触发。要启用它们,请设置

By default, intellisence / quick suggestions will not be triggered inside of a snippet. To enable them set

"editor.suggest.snippetsPreventQuickSuggestions": false

true 是默认值。

这篇关于Intellisense在代码段中不起作用-VS Code的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆