summaryrefslogtreecommitdiff
path: root/ted.c
diff options
context:
space:
mode:
Diffstat (limited to 'ted.c')
-rw-r--r--ted.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/ted.c b/ted.c
index c9ac007..8bc4f18 100644
--- a/ted.c
+++ b/ted.c
@@ -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) {