Skip to content

lsp-treemacs-call-hierarchy times out for Python with basedpyright. #179

@alamaison

Description

@alamaison

I'm using Emacs 30.1, the latest lsp-mode and lsp-treemacs from MELPA and the latest basedpyright as the LSP server implementation. When I call M-x lsp-treemacs-call-hierarchy with the cursor on a function definition, I eventually get the message helm-M-x-execute-command: Timeout while waiting for response. Method: textDocument/prepareCallHierarchy. But in the log I can see that prepareCallHierarchy returned quickly:


[Trace - 12:58:26 PM] Sending request 'textDocument/prepareCallHierarchy - (126)'.
Params: {
  "textDocument": {
    "uri": "file:///home/alex/path/to/my/file.py"
  },
  "position": {
    "line": 60,
    "character": 22
  }
}


[Trace - 12:58:26 PM] Received response 'textDocument/prepareCallHierarchy - (126)' in 2ms.
Result: [
  {
    "name": "run_document_download",
    "kind": 12,
    "uri": "file:///home/alex/path/to/my/file.py",
    "range": {
      "start": {
        "line": 60,
        "character": 10
      },
      "end": {
        "line": 60,
        "character": 31
      }
    },
    "selectionRange": {
      "start": {
        "line": 60,
        "character": 10
      },
      "end": {
        "line": 60,
        "character": 31
      }
    }
  }
]

If I call (lsp-request "textDocument/prepareCallHierarchy" (lsp--text-document-position-params)) directly I get the following traceback:

Debugger entered--Lisp error: (error "Timeout while waiting for response.  Method: textDocument/prepareCallHierarchy")
  signal(error ("Timeout while waiting for response.  Method: textDocument/prepareCallHierarchy"))
  error("Timeout while waiting for response.  Method: %s" "textDocument/prepareCallHierarchy")
  lsp-request("textDocument/prepareCallHierarchy" (:textDocument (:uri "file:///home/alex/path/to/my/file.py") :position (:line 60 :character 26)))
  eval((lsp-request "textDocument/prepareCallHierarchy" (lsp--text-document-position-params)) t)
  #f(compiled-function () #<bytecode 0x40becfeaac1167f>)()
  #f(compiled-function () #<bytecode -0x5db3e1955cb81d1>)()
  handler-bind-1(#f(compiled-function () #<bytecode -0x5db3e1955cb81d1>) (error) eval-expression--debug)
  eval-expression((lsp-request "textDocument/prepareCallHierarchy" (lsp--text-document-position-params)) nil nil 127)
  funcall-interactively(eval-expression (lsp-request "textDocument/prepareCallHierarchy" (lsp--text-document-position-params)) nil nil 127)
  call-interactively(eval-expression nil nil)
  command-execute(eval-expression)

I'm not sure how to start debugging further than this. Any idea what the problem is?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions