profile
viewpoint

Ask questionsenvironment variable to enable logging

I am trying to use this language server outside of VS Code. I have an initial JSON-RPC message in a text file and I am using < to feed it to Microsoft.Python.LanguageServer, but the executable just hangs. It would be great if I could use an environment variable to enable logging and get some idea of what is going on.

microsoft/python-language-server

Answer questions bolinfest

I am running Microsoft.Python.LanguageServer < initialize.json with the following as the contents of my initialize.json file, so I was hoping/expecting that a request from more data from the client would be written to stdout (or an error to stderr):

Content-Length: 5713

{
  "jsonrpc": "2.0",
  "id": 0,
  "method": "initialize",
  "params": {
    "initializationOptions": {
      "interpreter": {
        "properties": {
          "InterpreterPath": "/usr/local/bin/python3"
        }
      }
    },
    "rootPath": null,
    "rootUri": "file:///tmp",
    "capabilities": {
      "workspace": {
        "applyEdit": true,
        "workspaceEdit": {
          "documentChanges": true,
          "resourceOperations": [
            "create",
            "rename",
            "delete"
          ],
          "failureHandling": "textOnlyTransactional"
        },
        "didChangeConfiguration": {
          "dynamicRegistration": true
        },
        "didChangeWatchedFiles": {
          "dynamicRegistration": true
        },
        "symbol": {
          "dynamicRegistration": true,
          "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": true
        },
        "configuration": false,
        "workspaceFolders": true
      },
      "textDocument": {
        "publishDiagnostics": {
          "relatedInformation": true,
          "tagSupport": true
        },
        "synchronization": {
          "dynamicRegistration": true,
          "willSave": true,
          "willSaveWaitUntil": true,
          "didSave": true
        },
        "completion": {
          "dynamicRegistration": true,
          "contextSupport": true,
          "completionItem": {
            "snippetSupport": true,
            "commitCharactersSupport": true,
            "documentationFormat": [
              "markdown",
              "plaintext"
            ],
            "deprecatedSupport": true,
            "preselectSupport": true
          },
          "completionItemKind": {
            "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
            ]
          }
        },
        "hover": {
          "dynamicRegistration": true,
          "contentFormat": [
            "markdown",
            "plaintext"
          ]
        },
        "signatureHelp": {
          "dynamicRegistration": true,
          "signatureInformation": {
            "documentationFormat": [
              "markdown",
              "plaintext"
            ],
            "parameterInformation": {
              "labelOffsetSupport": true
            }
          }
        },
        "definition": {
          "dynamicRegistration": true,
          "linkSupport": true
        },
        "references": {
          "dynamicRegistration": true
        },
        "documentHighlight": {
          "dynamicRegistration": true
        },
        "documentSymbol": {
          "dynamicRegistration": true,
          "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
        },
        "codeAction": {
          "dynamicRegistration": true,
          "codeActionLiteralSupport": {
            "codeActionKind": {
              "valueSet": [
                "",
                "quickfix",
                "refactor",
                "refactor.extract",
                "refactor.inline",
                "refactor.rewrite",
                "source",
                "source.organizeImports"
              ]
            }
          }
        },
        "codeLens": {
          "dynamicRegistration": true
        },
        "formatting": {
          "dynamicRegistration": true
        },
        "rangeFormatting": {
          "dynamicRegistration": true
        },
        "onTypeFormatting": {
          "dynamicRegistration": true
        },
        "rename": {
          "dynamicRegistration": true,
          "prepareSupport": true
        },
        "documentLink": {
          "dynamicRegistration": true
        },
        "typeDefinition": {
          "dynamicRegistration": true,
          "linkSupport": true
        },
        "implementation": {
          "dynamicRegistration": true,
          "linkSupport": true
        },
        "colorProvider": {
          "dynamicRegistration": true
        },
        "foldingRange": {
          "dynamicRegistration": true,
          "rangeLimit": 5000,
          "lineFoldingOnly": true
        },
        "declaration": {
          "dynamicRegistration": true,
          "linkSupport": true
        }
      }
    },
    "trace": "off",
    "workspaceFolders": null
  }
}
useful!

Related questions

How does this compare to pyls? hot 1
Stuck at analyzing in background and causing high cpu load hot 1
VS Code language server linter not recognizing "additional-builtins" from .pylintrc hot 1
Scipy Misses Most Functions hot 1
"Analyzing in background" message stuck with caching enabled (deadlock, no CPU usage) hot 1
VSCode with "Microsoft Python Analysis Engine" makes system unresponsive hot 1
The Python Tools server crashed 5 times in the last 3 minutes. The server will not be restarted. hot 1
"Analyzing in background" message stuck with caching enabled (deadlock, no CPU usage) hot 1
Github User Rank List