简体   繁体   English

我正在尝试在 VS Code 中启用错误曲线,但它不起作用并抛出错误消息

[英]I'm trying to enable error squiggles in VS Code and it's not working and throwing an error message

I'm coding in C++ in VS Code and when the code is wrong, the error squiggles aren't appearing.我在 VS Code 中使用 C++ 进行编码,当代码错误时,不会出现错误曲线。 And when I go into the command palette and use C/C++: Enable Error Squiggles I get the following:当我 go 进入命令面板并使用C/C++: Enable Error Squiggles我得到以下信息:

Command 'C/C++: Enable Error Squiggles' resulted in an error (command 'C_Cpp.EnableErrorSquiggles' not found)

I've tried restarting, checking for any updates, disabling and then enabling them.我尝试重新启动,检查任何更新,禁用然后启用它们。 Nothing stops this error from coming up.没有什么能阻止这个错误的出现。 I've also tried reinstalling it via VS Code but nothing seems to work.我也尝试通过 VS Code 重新安装它,但似乎没有任何效果。

Check to see if squiggles are enabled by going to the settings panel (ctrl+comma) then search for squiggles.通过转到设置面板 (ctrl+comma) 检查是否启用了 squiggles,然后搜索 squiggles。 Make sure the option is checked and enabled.确保选中并启用该选项。

The squiggles come from the Intellisense engine.曲线来自Intellisense引擎。

First, go to the setting by using ctrl + , .首先,使用ctrl + go 进行设置。 Then search for error squiggles and make sure the option is enabled.然后搜索错误曲线并确保该选项已启用。

Go to the setting by using "ctrl" + ",". Go 使用“ctrl”+“,”进行设置。 Then search for error squiggles.然后搜索错误曲线。 Take care that there are 2 sections in the settings.请注意设置中有 2 个部分。 Firstly go to the "user" section.首先 go 到“用户”部分。 Enable it or select "EnabledIfIncludesResolve".启用它或 select "EnabledIfIncludesResolve"。 Then check the "workspace" section too.然后也检查“工作区”部分。 If it's disabled there, then enable it or select "EnabledIfIncludesResolve".如果它在那里被禁用,则启用它或 select "EnabledIfIncludesResolve"。 This will definitely work.这肯定会奏效。

My best solution is:我最好的解决方案是:

  1. Find your workspace file name Like this settings.json找到你的工作区文件名 Like this settings.json

  2. Then, open the settings.json file然后,打开settings.json文件

  3. Next, find (or) Search "C_Cpp.errorSquiggles": "Disabled" -This Option in settings.json接下来,在settings.json中找到(或)搜索“C_Cpp.errorSquiggles”:“Disabled”-This Option

  4. Change the value: "C_Cpp.errorSquiggles": "Disabled" --> "C_Cpp.errorSquiggles": "Enabled" -This OK: My Explain: find this Line.- "C_Cpp:errorSquiggles": "Disabled" and change the value of "Disabled" to "Enabled" OK!更改值: "C_Cpp.errorSquiggles": "Disabled" --> "C_Cpp.errorSquiggles": "Enabled" -This OK: My Explain: find this Line.- "C_Cpp:errorSquiggles": "Disabled" 并更改值从“禁用”到“启用” OK!

  1. Simply, go to settings by using ctrl + comma .简单地说, go 使用ctrl + comma进行设置。
  2. Search for Error squiggles .搜索Error squiggles
  3. Enable it or select EnabledIfIncludesResolve .启用它或 select EnabledIfIncludesResolve
  4. Then click on Modified on Workspace , if it is disabled, then enable it.然后点击Modified on Workspace ,如果它被禁用,则启用它。

If you had accidentally disabled it, try this...如果你不小心禁用了它,试试这个...

  1. Do Ctrl + p, and type "settings.json"执行 Ctrl + p,然后输入“settings.json”

  2. You will find the file which contains the value您将找到包含该值的文件

    "C_Cpp.errorSquiggles": "Disabled"
  3. Change it into Enabled.将其更改为已启用。

So basically, I did try enabling the error squiggles from the user as well as workbench settings.所以基本上,我确实尝试从用户和工作台设置中启用错误曲线。 That didn't work.那没有用。

A better solution which worked for me was uninstalling the intellisense from VScode and reinstalling through this link: https://code.visualstudio.com/docs/editor/intellisense对我有用的更好的解决方案是从 VScode 卸载智能感知并通过此链接重新安装: https://code.visualstudio.com/docs/editor/intellisense

This worked like a charm.这就像一个魅力。 Sometimes intellisense becomes less intelligent and needs a refresh: :)有时智能感知变得不那么智能,需要刷新::)

暂无
暂无

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

相关问题 我正在尝试编写C代码对String进行排序,但始终在第13行显示错误消息 - I'm trying to write a C code to sort String, but there always shows an error message in line 13 我正在尝试在 VS 代码上运行 C,这就是终端上的内容。 我怎样才能解决这个问题? - I'm trying to run C on VS code and this is what's on terminal. How can I fix this? 我正在尝试为分配创建代码,但我不断收到我无法弄清楚的 memory 错误 - I'm trying to create code for an assignment and I keep getting a memory error that I can't figure out 我的 c# 代码在 Unity 中收到很少的错误消息 - I'm getting few error message in Unity with my c# code 尝试在 C 上运行 hello world 并且输出在 VS 上的 Mac 上抛出此错误:zsh: parse error near `&&' - Trying to run hello world on C and the output throwing this error on Mac on VS : zsh: parse error near `&&' 我scanf(%s,lastName);时遇到分段错误。 (内部代码) - I'm hitting a segmentation error when I scanf(%s,lastName); (body code inside) 尝试在 VS 代码中运行 c 代码或使用 gcc 错误编译它 - Trying to run c code in VS code or compiling it using gcc error 我正在尝试将文件读入数组并不断收到此错误 - I'm trying to read a file into an arrray and keep getting this error 我正在尝试使用C制作菜单,但是我的代码无法按照我想要的方式工作 - I'm trying to make a menu in C and my code is not working the way I want it to 这段代码有什么问题?。 几分钟前我刚刚学习了编程,我正在努力做到这一点 - What's wrong with this code?. I just learned programming a few minutes ago and I'm trying to make this
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM