summaryrefslogtreecommitdiff
path: root/lsp.c
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2022-12-30 14:40:47 -0500
committerpommicket <pommicket@gmail.com>2022-12-30 14:40:47 -0500
commitf2c8a3a77fdd7f397e04edcaf5dae5e7777f03b6 (patch)
tree337883c076b415fa50983a2cf3b5335aafded2e9 /lsp.c
parent91fc9b10e1700b482b13af1d25d95d80085a9b79 (diff)
better ted_active_lsp, fix memory bug
Diffstat (limited to 'lsp.c')
-rw-r--r--lsp.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/lsp.c b/lsp.c
index c8de1a7..60dd4d1 100644
--- a/lsp.c
+++ b/lsp.c
@@ -563,3 +563,15 @@ LSPDocumentPosition lsp_location_end_position(LSPLocation location) {
};
}
+bool lsp_covers_path(LSP *lsp, const char *path) {
+ bool ret = false;
+ SDL_LockMutex(lsp->workspace_folders_mutex);
+ arr_foreach_ptr(lsp->workspace_folders, LSPDocumentID, folder) {
+ if (str_has_path_prefix(path, lsp_document_path(lsp, *folder))) {
+ ret = true;
+ break;
+ }
+ }
+ SDL_UnlockMutex(lsp->workspace_folders_mutex);
+ return ret;
+}