Fix global fallback in fs.lua
I'd suggest doing the following in fs.lua.
if vim.fn.filereadable(binpath) == 0 then
- add_checkhealth_error(name)
+ return ''
end
if local_binpath == '' then
return get_global_exec(name)
end
+ add_checkhealth_error(name)
return local_binpath
The reason for this is that you probably want to check the PATH if there is no ~/node_modules for example. I have many Node-based linters and formatters installed globally through my system package manager and they're in /usr/bin instead of ./node_modules/.bin and patching the files as described made everything work. This will likely fix system/user global NPM packages too.
Please give me thoughts on this idea.
Thanks for pointing this out!
I'll have to take a look at it in the weekend, but from a quick look you're right in that it doesn't point to the right executable.
From what I see I think we can keep the add_checkhealth_error(name) where it is but add the empty string return after that, the fallback check will then be done in the global search logic get_global_exec.
From what I see I think we can keep the
add_checkhealth_error(name)where it is but add the empty string return after that, the fallback check will then be done in the global search logicget_global_exec.
I was thinking that the problem with that approach is that the health error will be added even if the global executable exists.
Ah I see, maybe we don't need to error for local bin checks then? And only error when both local and global check fails.
Can you try out PR #31 and see if that resolves the issue?
I think that does it
Can you add an option to globally disable local contexts?
Hmmm at this point I'd rather keep it as is, since it was my initial intention to pick up the tools from the local context before it would try and search one globally.
For now you can just mention a global context following the Advanced Setup