Skip to content

MethodError: no method matching Union{Int64, String}(::String) #651

@gdkrmr

Description

@gdkrmr

I think this fails because "initializationOptions": null,. LanguageServer.jl should be able to handle this, the protocol specification says:

interface InitializeParams extends WorkDoneProgressParams {

...

        /**
	 * User provided initialization options.
	 */
	initializationOptions?: any;

...

}

Stacktrace:

ERROR: MethodError: no method matching Union{Int64, String}(::String)ERROR: 
Stacktrace:TypeError: in new, expected Array{Symbol,1}, got Nothing

Stacktrace: [1] LanguageServer.InitializeParams
( [1] deserialize::(Dict{String,Any}):: at Serialization/home/gkraemer/progs/julia/lsp-julia/languageserver/LanguageServer/src/protocol/initialize.jl:111.Serializer{IOStream}, 
 [2] parse_params::(DataType):: at Type/home/gkraemer/progs/julia/julia-1.4/usr/share/julia/stdlib/v1.4/Serialization/src/Serialization.jl:1315{Val{:initialize}}, 
 [2] handle_deserialize::(Dict{String,Any}):: at Serialization/home/gkraemer/progs/julia/lsp-julia/languageserver/LanguageServer/src/requests/init.jl:123.Serializer{IOStream}, 
 [3] parse::(Int32):: at Type/home/gkraemer/progs/julia/julia-1.4/usr/share/julia/stdlib/v1.4/Serialization/src/Serialization.jl:799{LanguageServer.JSONRPC.Request}, 
 [3] deserialize::(Dict{String,Any}):: at Serialization/home/gkraemer/progs/julia/lsp-julia/languageserver/LanguageServer/src/jsonrpc.jl:46.Serializer{IOStream}, 
 [4] run::(DataType):: at LanguageServerInstance/home/gkraemer/progs/julia/julia-1.4/usr/share/julia/stdlib/v1.4/Serialization/src/Serialization.jl:1309)
 at  [4] /home/gkraemer/progs/julia/lsp-julia/languageserver/LanguageServer/src/languageserverinstance.jl:236handle_deserialize
( [5] top-level scope:: at Serializationnone:1.
Serializer
Process julia-ls stderr finished

lsp-mode is sending the following:

[Trace - 01:53:34 PM] Sending request 'initialize - (1)'.
Params: {
  "processId": null,
  "rootPath": "/home/gkraemer/.julia/dev/Base58",
  "clientInfo": {
    "name": "emacs",
    "version": "GNU Emacs 26.3 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.18.9)\n of 2019-08-30"
  },
  "rootUri": "file:///home/gkraemer/.julia/dev/Base58",
  "capabilities": {
    "workspace": {
      "workspaceEdit": {
        "documentChanges": true,
        "resourceOperations": [
          "create",
          "rename",
          "delete"
        ]
      },
      "applyEdit": true,
      "symbol": {
        "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
          ]
        }
      },
      "executeCommand": {
        "dynamicRegistration": false
      },
      "didChangeWatchedFiles": {
        "dynamicRegistration": true
      },
      "workspaceFolders": true,
      "configuration": true
    },
    "textDocument": {
      "declaration": {
        "linkSupport": true
      },
      "definition": {
        "linkSupport": true
      },
      "implementation": {
        "linkSupport": true
      },
      "typeDefinition": {
        "linkSupport": true
      },
      "synchronization": {
        "willSave": true,
        "didSave": true,
        "willSaveWaitUntil": true
      },
      "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
          ]
        },
        "hierarchicalDocumentSymbolSupport": true
      },
      "formatting": {
        "dynamicRegistration": true
      },
      "rangeFormatting": {
        "dynamicRegistration": true
      },
      "rename": {
        "dynamicRegistration": true,
        "prepareSupport": true
      },
      "semanticHighlightingCapabilities": {
        "semanticHighlighting": false
      },
      "codeAction": {
        "dynamicRegistration": true,
        "isPreferredSupport": true,
        "codeActionLiteralSupport": {
          "codeActionKind": {
            "valueSet": [
              "",
              "quickfix",
              "refactor",
              "refactor.extract",
              "refactor.inline",
              "refactor.rewrite",
              "source",
              "source.organizeImports"
            ]
          }
        }
      },
      "completion": {
        "completionItem": {
          "snippetSupport": true,
          "documentationFormat": [
            "markdown"
          ]
        },
        "contextSupport": true
      },
      "signatureHelp": {
        "signatureInformation": {
          "parameterInformation": {
            "labelOffsetSupport": true
          }
        }
      },
      "documentLink": {
        "dynamicRegistration": true,
        "tooltipSupport": true
      },
      "hover": {
        "contentFormat": [
          "markdown",
          "plaintext"
        ]
      },
      "foldingRange": {
        "dynamicRegistration": true
      },
      "callHierarchy": {
        "dynamicRegistration": false
      },
      "publishDiagnostics": {
        "relatedInformation": true,
        "tagSupport": {
          "valueSet": [
            1,
            2
          ]
        },
        "versionSupport": true
      }
    },
    "window": {
      "workDoneProgress": true
    }
  },
  "initializationOptions": null,
  "workDoneToken": "1"
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions