Open ztlevi opened 4 years ago
I don't have the time to test it now but this should work. Can you describe what exactly happens and add the logs?
I run
xhost +
and then it works.
lsp-jump-to-definition
to Deque from from typing import Deque
. Then it gives me: signal(cl-no-applicable-method (xref-item-location nil))
cl-no-applicable-method(#s(cl--generic :name xref-item-location :dispatches ((0 #s(cl--generic-generalizer :name eieio--gen$
apply(cl-no-applicable-method #s(cl--generic :name xref-item-location :dispatches ((0 #s(cl--generic-generalizer :name eiei$
#f(compiled-function (&rest args) #<bytecode 0x1638e45>)(nil)
apply(#f(compiled-function (&rest args) #<bytecode 0x1638e45>) nil nil)
xref-item-location(nil)
xref--pop-to-location(nil nil)
xref--show-xrefs(nil nil)
lsp-show-xrefs(nil nil nil)
lsp-find-locations("textDocument/definition" nil :display-action nil)
lsp-find-definition()
funcall-interactively(lsp-find-definition)
call-interactively(lsp-find-definition record nil)
command-execute(lsp-find-definition record)
execute-extended-command(nil "lsp-find-definition" "lsp-find-def")
funcall-interactively(execute-extended-command nil "lsp-find-definition" "lsp-find-def")
call-interactively(execute-extended-command nil nil)
command-execute(execute-extended-command)
xhost +
? I run it on my local shell and run start-emacs.sh
, but emacs is still start in terminal.I have the same question. I try lsp-find-reference
and get this error
Warning (lsp-mode): Failed to process xref entry for filename ’/docker:my-docker-langservers:/opt/ros/melodic/include/rosconsole/macros_generated.h’: Method ‘docker’ is not known.
The file path is known and correct within the container. Is there any way to open that file in an emacs buffer? Ideally it would still work with lsp-mode to facilitate further navigation.
If that is not possible, could there be a way to open the buffer using Tramp? In my case, changing the file path from /docker:my-docker-langserver:/opt/...
to /ssh:user@host#port:/opt/...
would work when the container is running sshd
.
@zflat can you try installing docker-tramp package?
Yes, that is the fix for handling the xref uri. However, I now have this issue: https://github.com/emacs-lsp/lsp-docker/issues/29
I have a branch that I am using to test a fix.
It seems like we are not able to jump to definitions where the source codes are installed as libraries in the docker container. For example, jump to native python libraries.
I'm not sure how to make this happen. So I tried to open emacs in the docker container with
emacslsp/lsp-docker-full
, then of course, we could jump to that definition.But I got another question. How to start emacs as gui from docker? There must some command line args that I don't know and I need to pass to enable gui...
So sum up the two question:
I have a minimal test repo over here which contains the minimal reproduce steps https://github.com/ztlevi/lsp-docker-test