microsoft / vscode-languageserver-node

Language server protocol implementation for VSCode. This allows implementing language services in JS/TS running on node.js
MIT License
1.48k stars 325 forks source link

Client error 'Failed to determine file type' after undoing rename with Cmd+Z #1581

Closed sergeysavchuk closed 3 weeks ago

sergeysavchuk commented 3 weeks ago
  1. Server registers feature of workspace/didRename, e.g. didRename: { filters: [{ pattern: { glob: '**/*.clientrc', matches: 'file' }}] }
  2. Open a folder with some .clientrc file
  3. Rename the *.clientrc file
  4. Undo the previous renaming with the hotkey: Cmd+Z
  5. The client reports error Failed to determine file type for <path to the renamed *.clientrc file from step 3>

OS version: macOs 15.1 (24B83)

It can be reproduced by using official lsp-sample with an additional server configuration, please see https://github.com/sergeysavchuk/vscode-extension-samples/tree/undo_renamed_file/lsp-sample (branch: undo_renamed_file)

Log: [Error - 11:56:30] Failed to determine file type for file:///Users//data/src/test/vscode-rename/testNew.clientrc. Image

dbaeumer commented 3 weeks ago

This shouldn't be an error. We should make this an info since we treat the file as a match to not loose anything.