Skip to content

Unknown json-rpc requests should get an error response, not be ignored #4610

@rymdbar

Description

@rymdbar

Information

VIM version: 2:8.2.2434-3+deb11u1
Operating System: Debian

What went wrong

For full description, and instructions on how to reproduce, please see: LuaLS/lua-language-server#2318

While lua-language-server shouldn't need to, it does attempt to call workspace/configuration:

{
  "id":1,
  "jsonrpc":"2.0",
  "method":"workspace/configuration",
  "params":{
    "items":[
      {
        "scopeUri":"file:///tmp/luals",
        "section":"Lua"
      },
      {
        "scopeUri":"file:///tmp/luals",
        "section":"files.associations"
      },
      {
        "scopeUri":"file:///tmp/luals",
        "section":"files.exclude"
      },
      {
        "scopeUri":"file:///tmp/luals",
        "section":"editor.semanticHighlighting.enabled"
      },
      {
        "scopeUri":"file:///tmp/luals",
        "section":"editor.acceptSuggestionOnEnter"
      }
    ]
  }
}

{
  "id":2,
  "jsonrpc":"2.0",
  "method":"workspace/configuration",
  "params":{
    "items":[
      {
        "scopeUri":"file:///tmp/luals",
        "section":"Lua"
      },
      {
        "scopeUri":"file:///tmp/luals",
        "section":"files.associations"
      },
      {
        "scopeUri":"file:///tmp/luals",
        "section":"files.exclude"
      },
      {
        "scopeUri":"file:///tmp/luals",
        "section":"editor.semanticHighlighting.enabled"
      },
      {
        "scopeUri":"file:///tmp/luals",
        "section":"editor.acceptSuggestionOnEnter"
      }
    ]
  }
}

{
  "id":3,
  "jsonrpc":"2.0",
  "method":"workspace/configuration",
  "params":{
    "items":[
      {
        "scopeUri":"file:///tmp/luals",
        "section":"Lua"
      },
      {
        "scopeUri":"file:///tmp/luals",
        "section":"files.associations"
      },
      {
        "scopeUri":"file:///tmp/luals",
        "section":"files.exclude"
      },
      {
        "scopeUri":"file:///tmp/luals",
        "section":"editor.semanticHighlighting.enabled"
      },
      {
        "scopeUri":"file:///tmp/luals",
        "section":"editor.acceptSuggestionOnEnter"
      }
    ]
  }
}

There are no responses from ale. While it is silly to attempt the call to a client lacking the capability, the Language Server Protocol Specification mandates that:

Every processed request must send a response back to the sender of the request.

From context it appears this must is to be considered a MUST as defined by rfc2119.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions