mirror of
https://github.com/nix-community/nixvim.git
synced 2025-07-15 03:34:31 +02:00
plugins: Introduce helpers.defaultNullOpts.mkLuaFn (#855)
This allows to avoid calling `mkRaw` on lua functions, as they will get applied automatically. This could also help in the future to refactor the use of Lua code to make it more user-friendly.
This commit is contained in:
parent
b38dbdb0dc
commit
1d8e7906c9
30 changed files with 140 additions and 119 deletions
|
@ -61,7 +61,7 @@
|
|||
`:LspStart` (|lspconfig-commands|).
|
||||
'';
|
||||
|
||||
rootDir = helpers.mkNullOrOption types.str ''
|
||||
rootDir = helpers.defaultNullOpts.mkLuaFn "nil" ''
|
||||
A function (or function handle) which returns the root of the project used to
|
||||
determine if lspconfig should launch a new language server, or attach a previously
|
||||
launched server when you open a new buffer matching the filetype of the server.
|
||||
|
@ -110,7 +110,7 @@
|
|||
extraOptions =
|
||||
{
|
||||
inherit (cfg) cmd filetypes autostart;
|
||||
root_dir = helpers.mkRaw cfg.rootDir;
|
||||
root_dir = cfg.rootDir;
|
||||
on_attach =
|
||||
helpers.ifNonNull' cfg.onAttach
|
||||
(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue