diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2025-01-11 15:11:16 +0100 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2025-01-11 15:11:16 +0100 |
| commit | 29afc301ea05bc907444b698c91b141c26167baa (patch) | |
| tree | 63141257deab54705be8c937ef7f1c0b95b7512d /init.lua | |
| parent | f04bb93e982060ed27e5cf6e4a8d97edeb0910b6 (diff) | |
| download | vis-lspc-29afc301ea05bc907444b698c91b141c26167baa.tar.gz vis-lspc-29afc301ea05bc907444b698c91b141c26167baa.zip | |
make universal root detection opt-in
Diffstat (limited to 'init.lua')
| -rw-r--r-- | init.lua | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -1262,16 +1262,23 @@ end local function find_root_uri(ls, file_path) local globs = '' - local roots = ls.roots + local roots = ls.conf.roots if roots then for _, glob in ipairs(roots) do globs = globs .. glob .. '\n' end end - globs = globs .. '.git\n.hg\n' + if lspc.universal_root_globs then + for _, glob in ipairs(lspc.universal_root_globs) do + globs = globs .. glob .. '\n' + end + end local root_path = util.find_upwards(globs, file_path) + if not root_path and lspc.fallback_dirname_as_root then + root_path = util.dirname(file_path) + end return root_path and path_to_uri(root_path) end |
