vscode-checkstyle icon indicating copy to clipboard operation
vscode-checkstyle copied to clipboard

Does not work (possibly homebrew, possibly apex?)

Open AndrewRayCode opened this issue 5 years ago • 6 comments

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.

AndrewRayCode avatar Nov 14 '19 00:11 AndrewRayCode

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"
]

Vigilans avatar Nov 14 '19 01:11 Vigilans

That's a file to check, not an extension

AndrewRayCode avatar Nov 14 '19 03:11 AndrewRayCode

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

AndrewRayCode avatar Nov 14 '19 19:11 AndrewRayCode

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?

jdneo avatar Nov 15 '19 01:11 jdneo

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.

Vigilans avatar Nov 15 '19 01:11 Vigilans

I'd also like to see this implemented as well

will-triplemint avatar Nov 09 '21 13:11 will-triplemint