jdneo / vscode-checkstyle

Checkstyle extension for VS Code
https://marketplace.visualstudio.com/items?itemName=shengchen.vscode-checkstyle
GNU Lesser General Public License v3.0
68 stars 15 forks source link

Does not work (possibly homebrew, possibly apex?) #263

Open AndrewRayCode opened 4 years ago

AndrewRayCode commented 4 years ago

I installed checkstyle via homebrew, and this command works fine:

checkstyle -c checkstyle.xml app/classes/MyClass.cls
Line contains a tab character. [FileTabCharacter]

This plugin does nothing however.

The only setting I added is:

"java.checkstyle.configuration": "./checkstyle.xml"

When I save MyClass.cls or manually run this plugin's checkstyle command, nothing happens and no output is generated.

Vigilans commented 4 years ago

It seems that MyClass.cls is a third-party checkstyle extension?

You may wish to specify it in java.checkstyle.modules, see #206

e.g.

"java.checkstyle.modules": [
    "${workspaceFolder}/app/classes/MyClass.cls"
]
AndrewRayCode commented 4 years ago

That's a file to check, not an extension

AndrewRayCode commented 4 years ago

Ah, looks like this extension ignores checkstyle preferences and only registers itself for the "java" language mode: https://github.com/jdneo/vscode-checkstyle/blob/f194657a25096d8872dd76fdaf7a54ceb44fcfae/src/extension.ts#L47

My file is "Apex" language mode (which checkstyle fully supports, since it's a flavor of Java syntax), and the file extensions are .cls, but this plugin doesn't allow for other file types

jdneo commented 4 years ago

Hi @AndrewRayCode,

I have a question which might not related with this issue. By saying writing with Apex, are you using the Java Language Support language or other Apex related extension?

Vigilans commented 4 years ago

Thanks for your investigation!

I also noticed that checkstyle plugin will only watch the change of java file...

I remembered that checkstyle itself will check whether the file extension is supported, and the only supported extension seems to be .java. Your investigation shows that I've made some mistakes. Once I confirm that checkstyle will allow it in our code path, I will add support for your file's type.

will-triplemint commented 2 years ago

I'd also like to see this implemented as well