diff options
author | pommicket <pommicket@gmail.com> | 2022-12-23 21:43:07 -0500 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2022-12-23 21:43:07 -0500 |
commit | 8d96a4b0f0ebb059a63cc4c3193e0169ccf4f5b5 (patch) | |
tree | 7155b5d90b9eb8836fa637ed1db44f4e3304fdba /ted.c | |
parent | aabe543ee93796330158fa7fd247fb1ebeb8e3bb (diff) |
framework for having multiple/configurable LSPs
Diffstat (limited to 'ted.c')
-rw-r--r-- | ted.c | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -66,9 +66,15 @@ Settings *ted_active_settings(Ted *ted) { return settings; } -LSP *ted_get_lsp(Ted *ted, Language lang) { - // @TODO - return ted->test_lsp; +LSP *ted_get_lsp(Ted *ted, const char *path, Language lang) { + for (int i = 0; i < TED_LSP_MAX; ++i) { + LSP *lsp = ted->lsps[i]; + if (!lsp) break; + if (lsp->language != lang) continue; + if (!str_has_prefix(path, lsp->root_dir)) continue; + return lsp; + } + return NULL; } LSP *ted_get_active_lsp(Ted *ted) { |