Skip to content

Commit a10e73e

Browse files
authored
simplify default config (#814)
1 parent d54920c commit a10e73e

File tree

1 file changed

+9
-24
lines changed

1 file changed

+9
-24
lines changed

pages/installation.md

+9-24
Original file line numberDiff line numberDiff line change
@@ -176,30 +176,15 @@ of whether you are using mason or others, you can use this
176176
configuration below as a reference:
177177

178178
```lua
179-
local lspconfig = require("lspconfig")
180-
local configs = require("lspconfig.configs")
181-
182-
local lexical_config = {
183-
filetypes = { "elixir", "eelixir", "heex" },
184-
cmd = { "/my/home/projects/_build/dev/package/lexical/bin/start_lexical.sh" },
185-
settings = {},
186-
}
187-
188-
if not configs.lexical then
189-
configs.lexical = {
190-
default_config = {
191-
filetypes = lexical_config.filetypes,
192-
cmd = lexical_config.cmd,
193-
root_dir = function(fname)
194-
return lspconfig.util.root_pattern("mix.exs", ".git")(fname) or vim.loop.os_homedir()
195-
end,
196-
-- optional settings
197-
settings = lexical_config.settings,
198-
},
199-
}
200-
end
201-
202-
lspconfig.lexical.setup({})
179+
require('lspconfig').lexical.setup {
180+
cmd = { "my/home/projects/_build/dev/package/lexical/bin/start_lexical.sh" },
181+
root_dir = function(fname)
182+
return util.root_pattern("mix.exs", ".git")(fname) or vim.loop.cwd()
183+
end,
184+
filetypes = { "elixir", "eelixir", "heex" },
185+
-- optional settings
186+
settings = {}
187+
}
203188
```
204189

205190
If the configuration above doesn't work for you, please try this minimal [neovim configuration](https://github.com/scottming/nvim-mini-for-lexical), It can eliminate other plugin factors.

0 commit comments

Comments
 (0)