KamasamaK / vscode-cflint

An extension to integrate CFLint into Visual Studio Code.
MIT License
17 stars 9 forks source link

Linter no longer runs at all #27

Closed Edge-MarcG closed 3 years ago

Edge-MarcG commented 3 years ago

I have discovered that CFLint has stopped running, this is after it would work on save/on open and running manually. Furthermore, it would appear that when I tell it to run and output to a specific format, I can see the output of the command it attempt to run when using the Debugger Console and it appears similar to the following:

java.exe -jar \CFLint-1.5.0-all.jar -stdin \MyCFC.cfc -q -e -json -jsonfile \cflint-results-MyCFC-1611540759554.json

Yet even running in this mode never generates the json output file.

I do have your CFML extension installed as well and as noted, it was running fine up until recently and no other changes/extensions were installed/etc.

I also did further testing, attempting to use OpenJDK (I was running on the standard Oracle JVM before), and no differences were observed, it would just not run.

Finally, I attempted to run the cflint jar via the command line directly and the same behavior occurred there, where with "-stdin" it would just hang and never complete. I then discovered that the command line also offers the option to run with "-file" and when I ran with that parameter, the linter finally ran and generated expected output.

I have tested this on a few different systems and have observed this behavior across multiple systems (different OSes even) and am unsure what next steps to take might be. I'm unsure why the use of "-stdin" is not letting it complete and am curious if the extension could be updated to use "-file" instead. It does not appear to cause any undue issues and allows the linter to run and generate the output as expected.

Thanks again.

KamasamaK commented 3 years ago

Running using -stdin is not the issue. This extension hasn't been updated in over a year, so the fact that it just started happening should be an indication of that. It has to use stdin so linting can be run on unsaved documents.

The most likely cause is the setting cflint.enabled. My other extension for CFML forces that setting to be disabled while it's doing the initial scanning or else the "onOpen" event in this extension is executed for every component in the workspace, and then it reverts the setting. It's possible that it was not reverted if, for whatever reason, that scan was interrupted.

Edge-MarcG commented 3 years ago

Hmm - Well I confirmed that the cflint is enabled via the UI, when I looked at the json settings it didn't appear there, so I added it with it set to true. I closed and restarted VS code and waited for the CFML extension to scan all the components/etc., then attempted to run the linter manually on an open file and it just does nothing at all. I'm happy to provide more debug/context as well.

As it stands, none of the options to run the linter appear to work at all and I'm just not sure what else to do. I also did not change/install any new extensions recently, the only possible change was the installation of the latest update for VS Code. I have also completely uninstalled and re-installed VS Code and continue to get the same behavior.

KamasamaK commented 3 years ago

Did you check the Workspace setting too? It doesn't sound like anything else changed. And no one else, including myself, has had this sudden problem.

Edge-MarcG commented 3 years ago

Yes, I made sure it was enabled at both the workspace and user levels, closed and restarted code a couple of times and still the same behavior. At this point, even though I didn't add/change other extensions, I'll try a fresh install and put extensions back in place one at a time to see what happens. Thanks.

Edge-MarcG commented 3 years ago

After more debugging and a variety of testing, it would appear that the issue was related to my workspace in VSCode. I closed the workspace I had and opened just an individual folder of code and upon doing so, the linter started functioning again. I then closed that folder, quit VS Code and upon re-launch re-opened my workspace folder and the linter started working once again there.

My workspace does consist of about 5-8 folders of different projects and when the core CFML plugin starts, it does note that it's caching/reviewing just around 1000 components. I'm unsure if having VS Code open for long periods of time (in some cases days on end) causes some type of leak/memory issue which then subsequently caused the linter to just stop being enabled/functioning for the workspace perhaps.

In either case, I'll mark this as closed and if it comes up again, I'll do the same process to close out my active workspace and re-launch it to see if that restores expected behavior.

Thanks.