Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support lsp-bridge in container correctly #1009

Merged
merged 2 commits into from
Aug 3, 2024

Conversation

nohzafk
Copy link
Contributor

@nohzafk nohzafk commented Aug 3, 2024

Unify the logic for remote SSH file and docker file

When using find-file to open a file in container, the TRAMP buffer is now setup as the lsp-bridge buffer

  • we treat the TRAMP buffer as a non-file buffer by setting buffer-file-name to nil
  • previous impl is not correct (create a new buffer for docker file and close the corresponding TRAMP buffer)

Support apheleia formatter in container

Update README for how to setup PATH for remote command execution, otherwise the formatter binary won't be found (for example ruff, even it is installed in container)

Support find defition in container

Support using lsp-bridge-find-def lsp-bridge-find-def-return lsp-bridge-find-def-other-window in container.

Text Matrix

lsp-bridge-find-def-select-in-open-windows docker file lsp-bridge-find-def/-return lsp-bridge-find-def-other-window
nil yes pass - jump to another file and jump back
pass - jump to current file and jump back
pass - open a new window
nil no pass - jump to another file and jump back
pass - jump to current file and jump back
pass - open a new window
t yes jump to opened window - pass pass - jump to opened window
t no jump to opened window - pass pass - jump to opened window

issue

Under current implementation if jump to other window, lsp-bridge-find-def-return can't jump back to original window. It would be nice if we support jump back to original window.

```elisp
;; setup PATH for remote command execution
(with-eval-after-load 'tramp
(add-to-list 'tramp-remote-path "~/.nix-profile/bin")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lsp-bridge user must be install Nix?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

container support is done by using the devcontainer feature which use nix to install lsp-bridge and language server.

I'm planing to create a separate repo for instructions and setup of how to use lsp-bridge in container. Will update README to point to the new repo later.

@manateelazycat manateelazycat merged commit 2363b87 into manateelazycat:master Aug 3, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants