Repository: sublimelsp/LSP

Issue:
Missing codeActionKind entry prevents RLS init
* OS and language server
macOS 10.14.6, rls 1.35.0 (49efc06 2019-04-06)
* How you installed LSP (Package Control or from git?)
LSP installed from package control today
* Minimal reproduction steps
Install current stable Rust RLS, latest LSP release, enable LSP in Rust project
* Log

    [2019-06-28T16:08:36Z ERROR rls::server] dispatch error: Error { code: InvalidParams, message: "missing field `codeActionKind`", data: None }, message:


      {
      "jsonrpc": "2.0",
      "id": 1,
      "params": {
        "rootPath": "/Users/sth/dev/proj",
        "capabilities": {
          "workspace": {
            "applyEdit": true,
            "executeCommand": {},
            "didChangeConfiguration": {}
          },
          "textDocument": {
            "codeAction": {
              "dynamicRegistration": true,
              "codeActionLiteralSupport": {}
            },
            "documentSymbol": {
              "symbolKind": {
                "valueSet": [
                  1,
                  2,
                  3,
                  4,
                  5,
                  6,
                  7,
                  8,
                  9,
                  10,
                  11,
                  12,
                  13,
                  14,
                  15,
                  16,
                  17,
                  18,
                  19,
                  20,
                  21,
                  22,
                  23,
                  24,
                  25,
                  26
                ]
              }
            },
            "rangeFormatting": {},
            "rename": {},
            "completion": {
              "completionItem": {
                "snippetSupport": true
              },
              "completionItemKind": {
                "valueSet": [
                  1,
                  2,
                  3,
                  4,
                  5,
                  6,
                  7,
                  8,
                  9,
                  10,
                  11,
                  12,
                  13,
                  14,
                  15,
                  16,
                  17,
                  18
                ]
              }
            },
            "signatureHelp": {
              "signatureInformation": {
                "parameterInformation": {
                  "labelOffsetSupport": true
                },
                "documentationFormat": [
                  "markdown",
                  "plaintext"
                ]
              }
            },
            "formatting": {},
            "references": {},
            "synchronization": {
              "didSave": true
            },
            "documentHighlight": {},
            "definition": {},
            "hover": {
              "contentFormat": [
                "markdown",
                "plaintext"
              ]
            }
          }
        },
        "processId": 39815,
        "rootUri": "file:///Users/sth/dev/proj"
      },
      "method": "initialize"}
    


This appears to be related to a missing `codeActionKind` field sent as part of the init, within `codeActionLiteralSupport`.

Per the spec and some other extant implementations, an init message containing a complete `codeKindAction` entry might look like:


    {
      "jsonrpc": "2.0",
      "id": 1,
      "params": {
        "rootPath": "/Users/sth/dev/proj",
        "capabilities": {
          "workspace": {
            "applyEdit": true,
            "executeCommand": {},
            "didChangeConfiguration": {}
          },
          "textDocument": {
            "codeAction": {
              "dynamicRegistration": true,
              "codeActionLiteralSupport": {
                "codeActionKind": {
                  "valueSet": [
                    "",
                    "quickfix",
                    "refactor",
                    "refactor.extract",
                    "refactor.inline",
                    "refactor.rewrite",
                    "source",
                    "source.organizeImports"
                  ]
                }
              }
            },
            "documentSymbol": {
              "symbolKind": {
                "valueSet": [
                  1,
                  2,
                  3,
                  4,
                  5,
                  6,
                  7,
                  8,
                  9,
                  10,
                  11,
                  12,
                  13,
                  14,
                  15,
                  16,
                  17,
                  18,
                  19,
                  20,
                  21,
                  22,
                  23,
                  24,
                  25,
                  26
                ]
              }
            },
            "rangeFormatting": {},
            "rename": {},
            "completion": {
              "completionItem": {
                "snippetSupport": true
              },
              "completionItemKind": {
                "valueSet": [
                  1,
                  2,
                  3,
                  4,
                  5,
                  6,
                  7,
                  8,
                  9,
                  10,
                  11,
                  12,
                  13,
                  14,
                  15,
                  16,
                  17,
                  18
                ]
              }
            },
            "signatureHelp": {
              "signatureInformation": {
                "parameterInformation": {
                  "labelOffsetSupport": true
                },
                "documentationFormat": [
                  "markdown",
                  "plaintext"
                ]
              }
            },
            "formatting": {},
            "references": {},
            "synchronization": {
              "didSave": true
            },
            "documentHighlight": {},
            "definition": {},
            "hover": {
              "contentFormat": [
                "markdown",
                "plaintext"
              ]
            }
          }
        },
        "processId": 39815,
        "rootUri": "file:///Users/sth/dev/proj"
      },
      "method": "initialize"
     }


Discussion:
I think this was fixed in ada565c70425, I'm not sure if that's already released.
@rwols Having a look at the diff, it looks like ada565c adds `codeAction` but not `codeActionKind` – it seems to add an empty `codeActionLiteralSupport` entry (https://github.com/tomv564/LSP/commit/ada565c70425c78dc25a24506a0bd0ccbfd0bbfc#diff-717d01587e1b2a2e5e0ed467080c2c32R139), although I may be misunderstanding, and the entry is subsequently populated?
You are correct - for the initial implementation I only wanted to provide code action literal support without trying to understand what codeActionKind means for Sublime Text. 

Can you confirm if an empty array would work there ? 
@tomv564 Yep, let me see if adding an empty entry satisfies RLS

Resolving patch:
diff --git a/plugin/core/sessions.py b/plugin/core/sessions.py
--- a/plugin/core/sessions.py
+++ b/plugin/core/sessions.py
@@ -136,7 +136,11 @@ def get_initialize_params(project_path: str, config: ClientConfig):
                 "rangeFormatting": {},
                 "definition": {},
                 "codeAction": {
-                    "codeActionLiteralSupport": {}
+                    "codeActionLiteralSupport": {
+                        "codeActionKind": {
+                            "valueSet": []
+                        }
+                    }
                 },
                 "rename": {}
             },


Test patch: