mirror of
https://github.com/neovim/neovim.git
synced 2025-11-17 15:51:32 +00:00
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.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user