microsoft / language-server-protocol

Defines a common protocol for language servers.
https://microsoft.github.io/language-server-protocol/
Creative Commons Attribution 4.0 International
10.95k stars 766 forks source link

Question about FileOptionRegistrationOptions filters #1839

Closed luckasRanarison closed 8 months ago

luckasRanarison commented 8 months ago

https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#fileOperationRegistrationOptions

The typescript-language-server (tsserver) has the following registration options filters associated to willRename, it only matches file but tsserver also supports willRename on folder.

[
  {
    "scheme": "file",
    "pattern": {
      "matches": "file",
      "glob": "**/*.{ts,js,jsx,tsx,mjs,mts,cjs,cts}"
    }
  }
]

Unlike tsserver, rust_analyzer explicitly includes folders like this:

{
  "scheme": "file",
  "pattern": {
    "matches": "folder",
    "glob": "**"
  }
}

So should the client match all the files and folders by default and constrain the matches when given some filters? Or should it only match the files or folders given by the filters? (In that case, tsserver might be providing wrong registration options)

luckasRanarison commented 8 months ago

It seems that they just forgot to put the filter, closing this.