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

Can’t run typescript-language-server over TRAMP (Windows local machine, Linux remote machine) #3364

Closed
2 of 3 tasks
Aankhen opened this issue Feb 23, 2022 · 0 comments · Fixed by #4204
Closed
2 of 3 tasks
Labels

Comments

@Aankhen
Copy link

Aankhen commented Feb 23, 2022

Thank you for the bug report

  • I am using the latest version of lsp-mode related packages.
  • I checked FAQ and Troubleshooting sections
  • You may also try reproduce the issue using clean environment using the following command: M-x lsp-start-plain

Bug description

I can’t run typescript-language-server over TRAMP because the rootUri has two extra slashes:

  "rootPath": "/home/user/src",
  "clientInfo": {
    "name": "emacs",
    "version": "GNU Emacs 27.2 (build 1, x86_64-w64-mingw32)\n of 2021-03-26"
  },
  "rootUri": "file:////home/user/src",

Steps to reproduce

  1. Set up SSH and install typescript-language-server on remote
    machine.
  2. Set up LSP and make TRAMP use remote language server:
(require 'typescript-mode)
(require 'lsp)

(lsp-register-client
    (make-lsp-client :new-connection (lsp-tramp-connection (list "typescript-language-server" "--stdio"))
                    :major-modes '(typescript-mode)
                    :remote? t
                    :server-id 'ts-ls))

(with-eval-after-load 'tramp
  (add-to-list 'tramp-remote-path 'tramp-own-remote-path))
  1. Open TypeScript file on remote machine.
  2. M-x typescript-mode
  3. M-x lsp

Expected behavior

typescript-language-server successfully starts on the remote machine.

Which Language Server did you use?

lsp-javascript with typescript-language-server@0.9.6

OS

Windows

Error callstack

*Messages*:

LSP :: Connected to [ts-ls:39720/starting].
LSP :: Error from the Language Server: Request initialize failed with message: [UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//") (Internal Error)

*lsp-log* (names changed):

Command "typescript-language-server --stdio" is present on the path.
Command "typescript-language-server --stdio" is present on the path.
Found the following clients for /ssh:hostname:/home/username/src/index.tsx: (server-id ts-ls, priority 0)
The following clients were selected based on priority: (server-id ts-ls, priority 0)

Log buffer (names changed):

  "rootPath": "/home/user/src",
  "clientInfo": {
    "name": "emacs",
    "version": "GNU Emacs 27.2 (build 1, x86_64-w64-mingw32)\n of 2021-03-26"
  },
  "rootUri": "file:////home/user/src",
@Aankhen Aankhen added the bug label Feb 23, 2022
yyoncho added a commit to yyoncho/lsp-mode that referenced this issue Oct 27, 2023
- This fixes the implementation of `lsp-mode` tramp support. After this PR the
remote clients will be automatically registered and in most of the cases it will
work out of the box. The remote connection is managed to a way similar to what
eglot does.

Fixes emacs-lsp#4158
Fixes emacs-lsp#4150
Fixes emacs-lsp#4158
Fixes emacs-lsp#4150
Fixes emacs-lsp#3841
Fixes emacs-lsp#3642
Fixes emacs-lsp#3579
Fixes emacs-lsp#3530
Fixes emacs-lsp#3491
Fixes emacs-lsp#3490
Fixes emacs-lsp#3391
Fixes emacs-lsp#3369
Fixes emacs-lsp#3364
Fixes emacs-lsp#3020
Fixes emacs-lsp#3018
Fixes emacs-lsp#3020
yyoncho added a commit to yyoncho/lsp-mode that referenced this issue Oct 30, 2023
- This fixes the implementation of `lsp-mode` tramp support. After this PR the
remote clients will be automatically registered and in most of the cases it will
work out of the box. The remote connection is managed to a way similar to what
eglot does.

Fixes emacs-lsp#4158
Fixes emacs-lsp#4150
Fixes emacs-lsp#4158
Fixes emacs-lsp#4150
Fixes emacs-lsp#3841
Fixes emacs-lsp#3642
Fixes emacs-lsp#3579
Fixes emacs-lsp#3530
Fixes emacs-lsp#3491
Fixes emacs-lsp#3490
Fixes emacs-lsp#3391
Fixes emacs-lsp#3369
Fixes emacs-lsp#3364
Fixes emacs-lsp#3020
Fixes emacs-lsp#3018
Fixes emacs-lsp#3020
@yyoncho yyoncho closed this as completed in d45aca0 Nov 1, 2023
yyoncho added a commit to yyoncho/lsp-mode that referenced this issue Nov 2, 2023
* Fix lsp-mode's tramp support

- This fixes the implementation of `lsp-mode` tramp support. After this PR the
remote clients will be automatically registered and in most of the cases it will
work out of the box. The remote connection is managed to a way similar to what
eglot does.

Fixes emacs-lsp#4158
Fixes emacs-lsp#4150
Fixes emacs-lsp#4158
Fixes emacs-lsp#4150
Fixes emacs-lsp#3841
Fixes emacs-lsp#3642
Fixes emacs-lsp#3579
Fixes emacs-lsp#3530
Fixes emacs-lsp#3491
Fixes emacs-lsp#3490
Fixes emacs-lsp#3391
Fixes emacs-lsp#3369
Fixes emacs-lsp#3364
Fixes emacs-lsp#3020
Fixes emacs-lsp#3018
Fixes emacs-lsp#3020

* Use executable-find with remote = t everywhere
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant