Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RenameParams does not reference TextDocumentPositionParams interface in the JSON metamodel #2077

Open
suzizecat opened this issue Dec 28, 2024 · 0 comments

Comments

@suzizecat
Copy link

Hi,

I just found that the RenameParams definition is lacking the properties making it inheriting the properties of TextDocumentPositionPrams in the JSON metamodel files.

This is true both for the 3.17 and 3.18 version of the metamodel file.

I discovered this when using a tool to generate C++ objects from the LSP metamodel, this missing information breaks proper inheritance and is a bit annoying to work around.

Best regards !


While the definition of RenameParams is

interface RenameParams extends TextDocumentPositionParams,
	WorkDoneProgressParams {
	/**
	 * The new name of the symbol. If the given name is not valid the
	 * request must return a [ResponseError](#ResponseError) with an
	 * appropriate message set.
	 */
	newName: string;
}

The JSON description is

{
    "name": "RenameParams",
    "properties": [
        {
            "name": "textDocument",
            "type": {
                "kind": "reference",
                "name": "TextDocumentIdentifier"
            },
            "documentation": "The document to rename."
        },
        {
            "name": "position",
            "type": {
                "kind": "reference",
                "name": "Position"
            },
            "documentation": "The position at which this request was sent."
        },
        {
            "name": "newName",
            "type": {
                "kind": "base",
                "name": "string"
            },
            "documentation": "The new name of the symbol. If the given name is not valid the\nrequest must return a {@link ResponseError} with an\nappropriate message set."
        }
    ],
    "mixins": [
        {
            "kind": "reference",
            "name": "WorkDoneProgressParams"
        }
    ],
    "documentation": "The parameters of a {@link RenameRequest}."
},

While it would be expected to have

{
    "kind": "reference",
    "name": "TextDocumentPositionParams"
}

in the mixins section instead of textDocument and position properties.

suzizecat added a commit to suzizecat/slang-lsp-tools that referenced this issue Dec 29, 2024
See microsoft/language-server-protocol#2077 for more
details.

This commit implements the changes to fix the generated files in order to match
the LSP specification rather than the metamodel file.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant