'linter' plugin issues
I’m not sure if this is something to do with notepad++ itself, or the plugin. So I thought I’d ask here first. I’ve been using the ‘linter’ notepad++ plugin for a while (from https://github.com/deadem/notepad-pp-linter ), which basically adds automatic linting and highlighting of problems detected by whatever linters you have (I use it with jshint and eslint for java files).
It does this dynamically so you’ll see changes as you modify the file.
At least, it did that on my windows 10 setup, I had to replace my PC and it came with windows 11. After reinstalling notepad and linter, I do not see the results of any changes, unless I switch to another tab and then switch back, in which case the appropriate linter is rerun and the state updated.
I’m wondering if moving to windows 11 (or possibly changing notepad++ version, as I think I wasn’t entirely up to date on my windows 10 machine) has stopped some message being picked up by the plugin.
I know next to nothing about how notepad++ communicates with plugins, but if there’s anything I can try (or I can write python so if anyone has any suggestions for a workround i can code up using the python script plugin, I’d be happy to do that).
You really don’t realise how much you miss automatic linting till it stops working!
The notepad-pp-linter available in Plugins Admin is from 2019; there is a DLL available in this dir which was updated in 2020.
However, in Notepad++ v8.3 in 2022, the code was changed to handle filesize > 2GB… but this required that any plugin that tries to access the text of open files needed to recompile with new header files (and thus release a new version) to be able to correctly read the text. Since a linter obviously needs access to the text of the file, it’s likely that the notepad-pp-linter plugin will not work with any Notepad++ from v8.3 or newer – so v8.2.1 might be the last Notepad++ version that will work with a non-updated version of that plugin.
Regarding PythonScript: you could launch definitely launch linters or similar from PS – I have a script nppOnSaveSyntaxCheck defined a NOTIFICATION.FILESAVED callback in PythonScript which does a syntax check on Python2 code or Perl code every time I save my source code (it was inspired by Alan’s post here with a link to a LuaScript version). For Python2, I just use PythonScript’s python interpreter to run the
compilecommand for syntax checking; but for Perl, I run the external process
perl -con the active file – so you could use similar code to run any external linter executable and process its output.
@PeterJones thanks. I eventually took a deep breath and cloned the repo, copied the latest header files and rebuilt. And - it now works…