csharp-language-server-protocol icon indicating copy to clipboard operation
csharp-language-server-protocol copied to clipboard

FileRename missing OldUri

Open tzwaan opened this issue 7 months ago • 3 comments

According to the LSP spec, the FileRename object should have an oldUri and newUri property, but the csharp record only seems to have a single Uri.

https://microsoft.github.io/language-server-protocol/specifications/lsp/3.18/specification/#fileRename

tzwaan avatar Jul 01 '25 08:07 tzwaan

Can you show example of where do you observe this in OmniSharp?

mason-chase avatar Jul 13 '25 04:07 mason-chase

@tzwaan Looking at the RenameFile model, I am seeing OldUri and NewUri. https://github.com/OmniSharp/csharp-language-server-protocol/blob/e0f59105d754879bf0fce0c6d4faec19f5a302af/src/Protocol/Models/RenameFile.cs#L15-L23

JoeRobich avatar Jul 16 '25 06:07 JoeRobich

That's the RenameFile model, which is used when sending a workspace edit from the server to the client: https://microsoft.github.io/language-server-protocol/specifications/lsp/3.18/specification/#renameFile

Not the FileRename model, which is used to send a notification from the client to the server that a file has been renamed: https://microsoft.github.io/language-server-protocol/specifications/lsp/3.18/specification/#fileRename

Digging though the repo, it looks like this issue has already been fixed in 2023, but was never pushed in a release. The commit is from october 22, 2023 while the latest release is from september 21, 2023. https://github.com/OmniSharp/csharp-language-server-protocol/commit/eb064226d0524e2d019875a6cb3325695cb56a05

tzwaan avatar Jul 16 '25 08:07 tzwaan