Open getaceres opened 4 years ago
Same here. I'm using:
Visual Studio Code 1.43.2 on Arch Linux Java Support 0.58.0 Checkstyle Plugin 1.3.2
After I set the checkstyle configuration file, it created a new .vscode
folder with a settings.json
file. Shouldn't it use the user settings file, located on the ~./.config/Code/User
folder?
Found the problem, the extension was using the wrong checkstyle version. After I set it to 8.30 it started working:
I also removed the .vscode
folder and set the ${workspaceFolder}/checkstyle.xml
on the user's setting file.
I just tested in Arch Linux as well and setting it to 8.30 with the embedded google_checks.xml file doesn't do anything. ¿What local checkstyle.xml file are you using?
I'm using a custom checkstyle. Make sure that mvn checkstyle:check
is working as well. Also make sure that you are using the same checkstyle version as defined in your pom.xml file.
@getaceres Could you share a sample project to us?
Sure, for example this simple project:
https://github.com/getaceres/webflux-simple-demo
executing mvn clean install will find several checkstyle violations while VSCode finds none.
On Mac, I observed you have to use the full path to point to the XML as ${workspaceFolder} does not seem to actually resolve to anything.
Found the problem, the extension was using the wrong checkstyle version. After I set it to 8.30 it started working:
I also removed the
.vscode
folder and set the${workspaceFolder}/checkstyle.xml
on the user's setting file.
+1, This worked for me!
Ubuntu 20.04.2 LTS VSCode 1.57.0 Checkstyle 1.4.0
I am having this exact problem.
No matter which checkstyle file I try to set, it just gives the: Checkstyle configuration file not set yet, skip the check.
Although, if I try to set it in the user or workspace settings I get the following error:
Error: Running the contributed command: 'java.execute.workspaceCommand' failed. at _executeContributedCommand (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:84:108254) at async Object.sendPendingDiagnostics (/home/<MY_USER>/.vscode/extensions/shengchen.vscode-checkstyle-1.4.0/dist/extension.js:1:87630)
UPDATE I spent some more time trying different settings and I found one that worked. I am not sure what works and what doesn't, but the following worked for me:
"java.checkstyle.version": "8.41",
and "java.checkstyle.configuration": "/home/<MY_USER>/.vscode/checkstyle.xml",
If I try to use a version beyong 8.41 I get the following error:
Error: Running the contributed command: 'java.execute.workspaceCommand' failed.
at _executeContributedCommand (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:84:108251)
at async Object.sendPendingDiagnostics (/home/<MY_USER>/.vscode/extensions/shengchen.vscode-checkstyle-1.4.0/dist/extension.js:1:87630)
I don't know if this is because of some changes to the actual checkstyle format in 8.42 and beyond or if it is this plugin.
I'm using the following environment:
Visual Studio Code 1.43.0 on MacOS Catalina Java Support 0.58.0 Checkstyle Plugin 1.3.0
When I execute the command "Set the checkstyle configuration file" I get a notification saying "Successfully set the Checkstyle configuration." but nothing changes in the editor and in the output of the plug in I see the following message:
"Checkstyle configuration file not set yet, skip the check."
No matter what file I select. I tried with the built in /google_checks.xml and /sun_checks.xml and also with https://github.com/checkstyle/checkstyle/blob/master/src/main/resources/google_checks.xml but the result is the same. This message and the checkstyle rules are not applied. I don't see any checkstyle error in any file editor and if I select the command "Check code with checkstyle" nothing happens.