BUG: `lint+` impedes file opening in Lite XL 2.1.3
PerilousBooklet opened this issue · 10 comments
After opening Lite XL 2.1.3 with the lintplus
plugin installed and the following configuration options in the init.lua
:
local lintplus = require "plugins.lintplus"
lintplus.setup.lint_on_doc_load() -- enable automatic linting upon opening a file
lintplus.setup.lint_on_doc_save() -- enable automatic linting upon saving a file
lintplus.load({"luacheck", "shellcheck", "python", "lacheck"})
this is the error that Lite XL outputs:
and this is the stacktrace:
Sun Feb 18 12:52:33 2024 [ERROR] Error creating child process: No such file or directory at /usr/share/lite-xl/core/init.lua:1227
stack traceback:
[C]: in function 'process.start'
/home/raffaele/.config/lite-xl/plugins/lintplus/liteipc.lua:10: in function 'plugins.lintplus.liteipc.start_process'
/home/raffaele/.config/lite-xl/plugins/lintplus/init.lua:251: in function 'plugins.lintplus.check'
/home/raffaele/.config/lite-xl/plugins/lintplus/init.lua:853: in upvalue 'load'
/usr/share/lite-xl/plugins/autoreload.lua:113: in upvalue 'doc_load'
/home/raffaele/.config/lite-xl/plugins/scm/init.lua:647: in upvalue 'doc_load'
/home/raffaele/.config/lite-xl/plugins/lintplus/init.lua:850: in function 'core.doc.load'
/usr/share/lite-xl/core/doc/init.lua:27: in upvalue 'new'
/usr/share/lite-xl/plugins/detectindent.lua:280: in upvalue 'doc_new'
/home/raffaele/.config/lite-xl/plugins/lsp_snippets.lua:612: in upvalue 'doc_new'
...(skipping 16 levels)
/usr/share/lite-xl/core/keymap.lua:267: in function 'core.keymap.on_mouse_pressed'
/usr/share/lite-xl/core/init.lua:1254: in upvalue 'on_event'
/usr/share/lite-xl/plugins/macro.lua:19: in function 'core.on_event'
[C]: in function 'xpcall'
/usr/share/lite-xl/core/init.lua:1226: in function 'core.try'
/usr/share/lite-xl/core/init.lua:1314: in function 'core.step'
/usr/share/lite-xl/core/init.lua:1404: in upvalue 'core_run'
/home/raffaele/.config/lite-xl/plugins/settings.lua:1896: in function 'core.run'
(...tail calls...)
[string "local core..."]:14: in function <[string "local core..."]:6>
[C]: in function 'xpcall'
[string "local core..."]:6: in main chunk
As far as I know, lacheck
isn't a linter we currently have in the repository.
local lintplus = require "plugins.lintplus"
lintplus.setup.lint_on_doc_load() -- enable automatic linting upon opening a file
lintplus.setup.lint_on_doc_save() -- enable automatic linting upon saving a file
lintplus.load({"luacheck", "shellcheck", "python", "lacheck"})
-- ^^^^^^^ here
Are you sure this isn't a typo?
lacheck
is a WIP linter that I'm working on adding.
It worked fine in Lite XL 2.1.1 with the PR code.
I still need to fix the regex though.
Can you share your linter's .lua configuration file? It's hard to tell what might be causing the issue without that. No such file or directory
suggests you may be specifying a path that Lite XL's subprocess API can't resolve to an executable file.
I just removed all changes related to lacheck
and Lite XL still can't open .lua
files only (it seems).
Here is the error message:
Mon Feb 19 23:30:15 2024 [ERROR] Error creating child process: No such file or directory at /usr/share/lite-xl/core/init.lua:1227
stack traceback:
[C]: in function 'process.start'
/home/raffaele/.config/lite-xl/plugins/lintplus/liteipc.lua:10: in function 'plugins.lintplus.liteipc.start_process'
/home/raffaele/.config/lite-xl/plugins/lintplus/init.lua:251: in function 'plugins.lintplus.check'
/home/raffaele/.config/lite-xl/plugins/lintplus/init.lua:853: in upvalue 'load'
/usr/share/lite-xl/plugins/autoreload.lua:113: in upvalue 'doc_load'
/home/raffaele/.config/lite-xl/plugins/scm/init.lua:647: in upvalue 'doc_load'
/home/raffaele/.config/lite-xl/plugins/lintplus/init.lua:850: in function 'core.doc.load'
/usr/share/lite-xl/core/doc/init.lua:27: in upvalue 'new'
/usr/share/lite-xl/plugins/detectindent.lua:280: in upvalue 'doc_new'
/home/raffaele/.config/lite-xl/plugins/lsp_snippets.lua:612: in upvalue 'doc_new'
...(skipping 16 levels)
/usr/share/lite-xl/core/keymap.lua:267: in function 'core.keymap.on_mouse_pressed'
/usr/share/lite-xl/core/init.lua:1254: in upvalue 'on_event'
/usr/share/lite-xl/plugins/macro.lua:19: in function 'core.on_event'
[C]: in function 'xpcall'
/usr/share/lite-xl/core/init.lua:1226: in function 'core.try'
/usr/share/lite-xl/core/init.lua:1314: in function 'core.step'
/usr/share/lite-xl/core/init.lua:1404: in upvalue 'core_run'
/home/raffaele/.config/lite-xl/plugins/settings.lua:1896: in function 'core.run'
(...tail calls...)
[string "local core..."]:14: in function <[string "local core..."]:6>
[C]: in function 'xpcall'
[string "local core..."]:6: in main chunk
This happens whenever I try to open a .lua
file by left-clicking on the project treeview.
Also, in my init.lua
I have this:
local lintplus = require "plugins.lintplus"
lintplus.setup.lint_on_doc_load() -- enable automatic linting upon opening a file
lintplus.setup.lint_on_doc_save() -- enable automatic linting upon saving a file
lintplus.load({"luacheck", "shellcheck", "python"})
Another thing: I just noticed that when lintplus
is loaded one of my Lite XL project workspaces doesn't open two .lua
files that it instead opens when lintplus
is disabled.
This happens whenever I try to open a
.lua
file by left-clicking on the project treeview.
This would signify it's failing to start luacheck
, as it defines a pattern that looks for .lua
file extensions.
Do you have luacheck
installed and in your PATH? (Try running luacheck
in your shell and see what happens.)
Unbelievable, for some reason I didn't have luacheck
installed.
I was sure I had it, I'm not sure why it wasn't installed.
Now it works, thanks. Can I close the issue?
Yes! If the case is resolved, then feel free to close 😄