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

FileRename record implementation is incorrect

Open hozuki opened this issue 2 years ago • 1 comments

In specification:

export interface FileRename {
    oldUri: string;
    newUri: string;
}

In protocol implementation:

public abstract record FileOperationItem
{
    public Uri Uri { get; init; } = null!;
}

public partial record FileRename : FileOperationItem;

When using DidRenameFileParams/WillRenameFileParams (handling workspace/didRenameFiles/workspace/willRenameFiles), items in request.Files only include one URI. I haven't tested the requests but I suppose the param objects cannot be deserialized as expected. (Packages like vscode-languagesclient implement this correctly.)


By the way, shouldn't these classes be named as DidRenameFilesParams/WillRenameFilesParams (plural form; the same also applies to corresponding handler classes and interfaces)?

hozuki avatar Oct 21 '23 11:10 hozuki

Hello, it appears that this fix is not in a release yet. Any idea when this will make it into a Release? In the meantime, is there any possible work around? I'm not sure if I can override the default deserializer for this message.

zreedy avatar Dec 13 '23 21:12 zreedy