在VS Code的“资源管理器”视图中,有色彩的圆点表示什么意思?

huangapple go评论79阅读模式
英文:

What does a colored dot in the Explorer View in VS Code mean?

问题

文件显示为红色字体的原因我不确定。这是它的外观:(链接:https://i.stack.imgur.com/KWnoM.png)

每当我尝试运行程序时,程序都成功运行,但在资源管理器中仍然显示为红色字体。

英文:

I am unsure why my file is appearing in red font. Here is what it looks like: (https://i.stack.imgur.com/KWnoM.png)

Whenever I am trying to run a program, the program runs successfully, still it showing red font in explorer.

答案1

得分: 2

红色标记在资源管理器标签中被称为问题装饰。还可以查看相关的 problems.decorations.enabled 设置。通常,红色用于表示错误级别的问题(黄色通常表示警告级别,蓝色通常表示信息级别,但根据您的颜色主题可能会有所不同)。

从您的截图来看,您的源代码中有大量问题(113个错误,5个警告)。

要摆脱问题装饰,我建议您实际修复这些问题。打开这些文件,您将看到红色波浪线下划线标出问题所在,并将鼠标悬停在上面以查看问题的描述,然后修复描述的问题。

您可以在“问题”面板中查看所有问题的概览,您可以通过命令面板中的“View: Toggle Problems”命令或菜单栏中的“View > Problems”来打开它。

您能够成功运行程序可能意味着您尚未正确配置项目中的智能感知。没有更多信息,很难知道您缺少什么。阅读 https://code.visualstudio.com/docs/languages/java 可能会对您有所帮助。

摆脱资源管理器视图中的这些装饰的一个非常愚蠢和不好的方法是将 problems.decorations.enabled: false 放入您的 settings.json 文件。我不建议这样做。解决问题是更好的方式。

英文:

The red dot in the explorer tab is called a problem decoration. See also the related problems.decorations.enabled setting. The red colour is typically for error-level problems (yellow typically for warning-level, blue typically for info-level, but it can vary based on your colour theme).

Taking a look at your screenshot, you have a whole heck-ton of problems in your source code (113 errors, 5 warnings).

To get rid of the problem decorations, I'd suggest to actually fix those problems. Open up those files and you'll see red squiggly underlines where the problems are, and hover over them to see what the problem is, and then fix the described problem.

You can view an overview of all problems in the Problems Panel, which you can open with the View: Toggle Problems command in the command palette, or View > Problems in the menu bar.

The fact that you can run your program successfully probably means that you just haven't yet properly configured IntelliSense in your project. It's impossible to know what you're missing without more info. It might help you to read https://code.visualstudio.com/docs/languages/java.

<sup>A really stupid and bad way to get rid of those decorations in the Explorer View is to put &quot;problems.decorations.enabled&quot;: false in your settings.json file. I don't recommend that. Fix the problems.</sup>

huangapple
  • 本文由 发表于 2023年4月17日 03:54:43
  • 转载请务必保留本文链接:https://go.coder-hub.com/76030027.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定