You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
By default, fennel-ls does not include fnl/ directories in its module and
macro search paths.
You may either pass updated paths as options to fennel-ls, via settings.fennel-ls.macro-path|fennel-path or (IMO, the simpler way)
set fnl/ as the root_dir for the lsp server, as shown below.
The root_dir option is a function, which receives the current buffer file path. vim.fs.find searches from this file path upwards through the tree until it
finds a directory named fnl or .git and returns a list of matching paths
(by default limited to only the first match). By fetching the first element, we
return the path .../fnl/ or nil if there is no match.
We also set "vim" as a valid global variable.
Below is an example configuration to pass to lspconfig.fennel_ls.setup():
Additionally you may want to disable hotpots own diagnostics as fennel-ls should provide the same errors along with additional linting. There should be no negative impact in keeping both enabled, besides the repeated error reporting.
With such a config, jump to definition (in another file under the same fnl/ directory) is working?
I have tried to make it work in the past with no success.
Guide assumes you're using
lspconfig
.By default, fennel-ls does not include
fnl/
directories in its module andmacro search paths.
You may either pass updated paths as options to fennel-ls, via
settings.fennel-ls.macro-path|fennel-path
or (IMO, the simpler way)set
fnl/
as theroot_dir
for the lsp server, as shown below.The
root_dir
option is a function, which receives the current buffer file path.vim.fs.find
searches from this file path upwards through the tree until itfinds a directory named
fnl
or.git
and returns a list of matching paths(by default limited to only the first match). By fetching the first element, we
return the path
.../fnl/
or nil if there is no match.We also set "vim" as a valid global variable.
Below is an example configuration to pass to
lspconfig.fennel_ls.setup()
:Additionally you may want to disable hotpots own diagnostics as fennel-ls should provide the same errors along with additional linting. There should be no negative impact in keeping both enabled, besides the repeated error reporting.
The text was updated successfully, but these errors were encountered: