Skip to content

Preserve types for backwards compatibility.#174

Merged
karthiknadig merged 1 commit into
microsoft:mainfrom
karthiknadig:bug1
Mar 3, 2023
Merged

Preserve types for backwards compatibility.#174
karthiknadig merged 1 commit into
microsoft:mainfrom
karthiknadig:bug1

Conversation

@karthiknadig
Copy link
Copy Markdown
Member

@karthiknadig karthiknadig commented Mar 3, 2023

This was the old definition (params was composed of two things) the combined type was aliased as WorkspaceConfigurationParams:

        {
            "method": "workspace/configuration",
            "result": {
                "kind": "array",
                "element": {
                    "kind": "reference",
                    "name": "LSPAny"
                }
            },
            "messageDirection": "serverToClient",
            "params": {
                "kind": "and",
                "items": [
                    {
                        "kind": "reference",
                        "name": "ConfigurationParams"
                    },
                    {
                        "kind": "reference",
                        "name": "PartialResultParams"
                    }
                ]
            },
            "documentation": "The 'workspace/configuration' request is sent from the server to the client to fetch a certain\nconfiguration setting.\n\nThis pull model replaces the old push model were the client signaled configuration change via an\nevent. If the server still needs to react to configuration changes (since the server caches the\nresult of `workspace/configuration` requests) the server should register for an empty configuration\nchange event and empty the cache if such an event is received."
        }

This is the new definition:

        {
            "method": "workspace/configuration",
            "result": {
                "kind": "array",
                "element": {
                    "kind": "reference",
                    "name": "LSPAny"
                }
            },
            "messageDirection": "serverToClient",
            "params": {
                "kind": "reference",
                "name": "ConfigurationParams"
            },
            "documentation": "The 'workspace/configuration' request is sent from the server to the client to fetch a certain\nconfiguration setting.\n\nThis pull model replaces the old push model were the client signaled configuration change via an\nevent. If the server still needs to react to configuration changes (since the server caches the\nresult of `workspace/configuration` requests) the server should register for an empty configuration\nchange event and empty the cache if such an event is received."
        }

I will preserve the aliasing in lsprotocol in cases like this.

Issue reference:
sublimelsp/LSP-ruff#8
openlawlibrary/pygls#317

@karthiknadig karthiknadig self-assigned this Mar 3, 2023
@karthiknadig karthiknadig added the bug Issue identified by VS Code Team member as probable bug label Mar 3, 2023
@karthiknadig karthiknadig marked this pull request as ready for review March 3, 2023 09:28
@karthiknadig karthiknadig enabled auto-merge (squash) March 3, 2023 09:29
@karthiknadig karthiknadig merged commit 2c98dcb into microsoft:main Mar 3, 2023
@karthiknadig karthiknadig deleted the bug1 branch March 3, 2023 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Issue identified by VS Code Team member as probable bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants