nvim_runtime_lua

vim.lsp._watchfiles

Methods4

function M._watchfunc(path: string, opts: vim._watch.watch.Opts | nil, callback: vim._watch.Callback) -> cancel fun() -> nil
Parameters
pathstring

The path to watch

optsvim._watch.watch.Opts | nil

Additional options:

  • uvflags (table|nil)
  • Same flags as accepted by |uv.fseventstart()|

callbackvim._watch.Callback

Callback for new events

Returns
cancelfun() -> nil

Stops the watcher

function M.register(reg: lsp.Registration, client_id: integer) -> nil

Registers the workspace/didChangeWatchedFiles capability dynamically.

Parameters
reglsp.Registration

LSP Registration object.

client_idinteger

Client ID.

Returns
nil
function M.unregister(unreg: lsp.Unregistration, client_id: integer) -> nil

Unregisters the workspace/didChangeWatchedFiles capability dynamically.

Parameters
unreglsp.Unregistration

LSP Unregistration object.

client_idinteger

Client ID.

Returns
nil
function M.cancel(client_id: integer) -> nil

Fields1

M._poll_exclude_pattern : vim.lpeg.Pattern

Default excludes the same as VSCode's files.watcherExclude setting. https://github.com/microsoft/vscode/blob/eef30e7165e19b33daa1e15e92fa34ff4a5df0d3/src/vs/workbench/contrib/files/browser/files.contribution.ts#L261