Skip to content

Spurious error when workspace/configuration receives [null] as response #644

Closed
@krobelus

Description

@krobelus

From https://microsoft.github.io/language-server-protocol/specifications/specification-current/#workspace_configuration regarding the workspace/configuration response

The order of the returned configuration settings correspond to the order of the passed ConfigurationItems
...
If the client can’t provide a configuration setting for a given scope then null needs to be present in the returned array.

My client does that - it look like

From server: {"jsonrpc":"2.0","id":1,"method":"workspace/configuration","params":{"items":[{"section":"bashIde"}]}}
To server: {"jsonrpc":"2.0","result":[null],"id":1}

bash-language-server response with window/logMessage of type warning:

updateConfiguration: failed with [
  {
    "code": "invalid_type",
    "expected": "object",
    "received": "null",
    "path": [],
    "message": "Expected object, received null"
  }
]

I think it should not. I guess I could send [{}] but IDK if that's a good idea

Originally reported in kakoune-lsp/kakoune-lsp#659

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions