Skip to content
Snippets Groups Projects
Select Git revision
  • release-0.10
  • master default
  • release-0.9
  • release-0.8
  • release-0.7
  • release-0.6
  • release-0.5
  • release-0.4
  • release-0.3
  • nightly
  • v0.10.1
  • stable
  • v0.10.0
  • v0.9.5
  • v0.9.4
  • v0.9.3
  • v0.9.2
  • v0.9.1
  • v0.9.0
  • v0.8.3
  • v0.8.2
  • v0.8.1
  • v0.8.0
  • v0.7.2
  • v0.7.1
  • v0.7.0
  • v0.6.1
  • v0.6.0
  • v0.5.1
29 results

_watchfiles.lua

Blame
    • Sean Dewar's avatar
      cc87dda3
      fix(lsp): do not assume client capability exists in watchfiles check (#24550) · cc87dda3
      Sean Dewar authored
      PR #23689 assumes `client.config.capabilities.workspace.didChangeWatchedFiles`
      exists when checking `dynamicRegistration`, but thats's true only if it was
      passed to `vim.lsp.start{_client}`.
      
      This caused #23806 (still an issue in v0.9.1; needs manual backport), but #23681
      fixed it by defaulting `config.capabilities` to `make_client_capabilities` if
      not passed to `vim.lsp.start{_client}`.
      
      However, the bug resurfaces on HEAD if you provide a non-nil `capabilities` to
      `vim.lsp.start{_client}` with missing fields (e.g: not made via
      `make_client_capabilities`).
      
      From what I see, the spec says such missing fields should be interpreted as an
      absence of the capability (including those indicated by missing sub-fields):
      https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#clientCapabilities
      
      Also, suggest `vim.empty_dict()` for an empty dict in
      `:h vim.lsp.start_client()` (`{[vim.type_idx]=vim.types.dictionary}`
      no longer works anyway, probably since the cjson switch).
      fix(lsp): do not assume client capability exists in watchfiles check (#24550)
      Sean Dewar authored
      PR #23689 assumes `client.config.capabilities.workspace.didChangeWatchedFiles`
      exists when checking `dynamicRegistration`, but thats's true only if it was
      passed to `vim.lsp.start{_client}`.
      
      This caused #23806 (still an issue in v0.9.1; needs manual backport), but #23681
      fixed it by defaulting `config.capabilities` to `make_client_capabilities` if
      not passed to `vim.lsp.start{_client}`.
      
      However, the bug resurfaces on HEAD if you provide a non-nil `capabilities` to
      `vim.lsp.start{_client}` with missing fields (e.g: not made via
      `make_client_capabilities`).
      
      From what I see, the spec says such missing fields should be interpreted as an
      absence of the capability (including those indicated by missing sub-fields):
      https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#clientCapabilities
      
      Also, suggest `vim.empty_dict()` for an empty dict in
      `:h vim.lsp.start_client()` (`{[vim.type_idx]=vim.types.dictionary}`
      no longer works anyway, probably since the cjson switch).