diff options
author | pommicket <pommicket@gmail.com> | 2022-12-30 14:40:47 -0500 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2022-12-30 14:40:47 -0500 |
commit | f2c8a3a77fdd7f397e04edcaf5dae5e7777f03b6 (patch) | |
tree | 337883c076b415fa50983a2cf3b5335aafded2e9 /lsp.c | |
parent | 91fc9b10e1700b482b13af1d25d95d80085a9b79 (diff) |
better ted_active_lsp, fix memory bug
Diffstat (limited to 'lsp.c')
-rw-r--r-- | lsp.c | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -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; +} |