diff options
author | Steven Arcangeli <506791+stevearc@users.noreply.github.com> | 2023-12-22 02:40:01 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-22 11:40:01 +0100 |
commit | 92204b06e7365cf4c68e6ea8258dce801f0a5df9 (patch) | |
tree | a3899c2bdfcdcf29ece83e426750d1f740894d47 /runtime/lua/vim/lsp/_dynamic.lua | |
parent | db0ec84fb46b8235f8651d5aa25eb56a9b117eb5 (diff) | |
download | rneovim-92204b06e7365cf4c68e6ea8258dce801f0a5df9.tar.gz rneovim-92204b06e7365cf4c68e6ea8258dce801f0a5df9.tar.bz2 rneovim-92204b06e7365cf4c68e6ea8258dce801f0a5df9.zip |
refactor(lsp): move glob parsing to util (#26519)
refactor(lsp): move glob parsing to vim.glob
Moving the logic for using vim.lpeg to create a match pattern from a
glob into `vim.glob`. There are several places in the LSP spec that
use globs, and it's very useful to have glob matching as a
generally-available utility.
Diffstat (limited to 'runtime/lua/vim/lsp/_dynamic.lua')
-rw-r--r-- | runtime/lua/vim/lsp/_dynamic.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/runtime/lua/vim/lsp/_dynamic.lua b/runtime/lua/vim/lsp/_dynamic.lua index 04040e8e28..4bee58559f 100644 --- a/runtime/lua/vim/lsp/_dynamic.lua +++ b/runtime/lua/vim/lsp/_dynamic.lua @@ -1,4 +1,4 @@ -local wf = require('vim.lsp._watchfiles') +local glob = require('vim.glob') --- @class lsp.DynamicCapabilities --- @field capabilities table<string, lsp.Registration[]> @@ -97,7 +97,7 @@ function M.match(bufnr, documentSelector) if matches and filter.scheme and not vim.startswith(uri, filter.scheme .. ':') then matches = false end - if matches and filter.pattern and not wf._match(filter.pattern, fname) then + if matches and filter.pattern and not glob.to_lpeg(filter.pattern):match(fname) then matches = false end if matches then |