aboutsummaryrefslogtreecommitdiffstats
path: root/lua/lspconfig/erlangls.lua
diff options
context:
space:
mode:
authorMichael Lingelbach <m.j.lbach@gmail.com>2021-11-11 01:00:24 -0800
committerGitHub <noreply@github.com>2021-11-11 01:00:24 -0800
commit0d1ce78d231773046320caa45fe1a18dfa366761 (patch)
treefde488c8490f93b6ad88ef8a32e77ff9b4e49d34 /lua/lspconfig/erlangls.lua
parentdocs: make CONTRIBUTING more visible via move (#1396) (diff)
downloadnvim-lspconfig-0d1ce78d231773046320caa45fe1a18dfa366761.tar
nvim-lspconfig-0d1ce78d231773046320caa45fe1a18dfa366761.tar.gz
nvim-lspconfig-0d1ce78d231773046320caa45fe1a18dfa366761.tar.bz2
nvim-lspconfig-0d1ce78d231773046320caa45fe1a18dfa366761.tar.lz
nvim-lspconfig-0d1ce78d231773046320caa45fe1a18dfa366761.tar.xz
nvim-lspconfig-0d1ce78d231773046320caa45fe1a18dfa366761.tar.zst
nvim-lspconfig-0d1ce78d231773046320caa45fe1a18dfa366761.zip
feat: add single file mode (#1385)
* This adds a "single file mode" option for each language server * Currently, if a root is not detected, a new language server is started for each file opened. * Root directory is set to `nil` in start_client. Some servers will refuse to start, or otherwise panic. This is opt-in per server. * Some servers, such as rust-analyzer, explicitly have a "single file mode", we will not support that until it is officially part of the LSP specification Co-authored-by: Peter Lithammer <peter.lithammer@gmail.com>
Diffstat (limited to 'lua/lspconfig/erlangls.lua')
-rw-r--r--lua/lspconfig/erlangls.lua7
1 files changed, 3 insertions, 4 deletions
diff --git a/lua/lspconfig/erlangls.lua b/lua/lspconfig/erlangls.lua
index a161a194..adaf9b35 100644
--- a/lua/lspconfig/erlangls.lua
+++ b/lua/lspconfig/erlangls.lua
@@ -5,9 +5,8 @@ configs.erlangls = {
default_config = {
cmd = { 'erlang_ls' },
filetypes = { 'erlang' },
- root_dir = function(fname)
- return util.root_pattern('rebar.config', 'erlang.mk', '.git')(fname) or util.path.dirname(fname)
- end,
+ root_dir = util.root_pattern('rebar.config', 'erlang.mk', '.git'),
+ single_file_support = true,
},
docs = {
description = [[
@@ -25,7 +24,7 @@ Installation requirements:
- [rebar3 3.9.1+](https://github.com/erlang/rebar3)
]],
default_config = {
- root_dir = [[root_pattern('rebar.config', 'erlang.mk', '.git') or util.path.dirname(fname)]],
+ root_dir = [[root_pattern('rebar.config', 'erlang.mk', '.git')]],
},
},
}