How to disable error highlighting in VS Code?

 ̄綄美尐妖づ 提交于 2021-01-26 21:55:22

问题


I need to disable error highlighting in Java files in VS Code. VS Code tries to check a Groovy file while thinking it is a Java file.

As you can see in the picture all imports after the first and the types after the first field are highlighted red (due to missing semicolons). However I do not want the error check for this Groovy file.

NOTE: I only have the plugins Clang, RedHat.Java, Markdown PDF, Sort Lines, and Uncrustify installed. Even if I disable all the red highlighting is visible.


回答1:


open your preferences file and add this

"java.validate.enable": false

I didn't try it for java, but it works for typescript.




回答2:


I found this:

"problems.decorations.enabled": false,



回答3:


You should disable the linter, which is by default enable in VS Code. To do so you can go to File-> Prefrences -> setting




回答4:


I wouldn't think this is necessary but you might try:

"files.associations": {
   ".groovy": "groovy"
}

in your user settings, assuming your file extension is .groovy. If it is something else, just set it to "groovy" as well. When I create a .groovy file with your content or gibberish I get no error linting at all. What is your file extension and what does Vscode call it in the bottom right of the editor? You can click on that file type to change its file associations. See modifying Vscode file extensions.



来源:https://stackoverflow.com/questions/46061857/how-to-disable-error-highlighting-in-vs-code

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!