emacs-lsp / lsp-mode

Emacs client/library for the Language Server Protocol
https://emacs-lsp.github.io/lsp-mode
GNU General Public License v3.0
4.75k stars 873 forks source link

lsp-mode hook looks wrong when using tramp mode #925

Closed Dav1d23 closed 5 years ago

Dav1d23 commented 5 years ago

Describe the bug The minibuffer shows an error, and lsp-mode does not work on remote files.

To Reproduce Using the configuration below, just open a file remotely via ssh.

;; LSP python mode
(use-package lsp-mode
  :ensure t
  :config
  (require 'lsp-clients)
  (add-hook 'prog-mode-hook 'lsp)

  (use-package lsp-ui
    :ensure t
    :config
    (setq lsp-ui-sideline-ignore-duplicate t)
    (setq lsp-ui-flycheck-enable nil)
    (add-hook 'lsp-mode-hook 'lsp-ui-mode))

  (use-package company-lsp
    :config
    (setq company-lsp-async t)
    (push 'company-lsp company-backends))

  (defun lsp-set-cfg ()
    (let ((lsp-cfg `(:pyls (:configurationSources ("flake8")))))
      (lsp--set-configuration lsp-cfg)))

  (add-hook 'lsp-after-initialize-hook 'lsp-set-cfg))

(lsp-register-client
 (make-lsp-client :new-connection (lsp-tramp-connection "pyls")
                  :major-modes '(python-mode)
                  :remote? t
                  :server-id 'pyls-remote))

Expected behavior I would expect it to work.

Which Language Server did you use I installed via conda-forge python-language-server

OS Centos7

Error callstack

Debugger entered--Lisp error: (wrong-number-of-arguments (1 . 1) 2)
  executable-find("pyls" "/ssh:<myserver>#12140:")
  lsp-server-present\?(("pyls"))
  #f(compiled-function () #<bytecode 0x132e7bd>)()
  #f(compiled-function (client) #<bytecode 0x326d589>)(#s(lsp--client :language-id nil :add-on? nil :new-connection (:connect #f(compiled-function (filter sentinel name) #<bytecode 0x132e7e1>) :test\? #f(compiled-function () #<bytecode 0x132e7bd>)) :ignore-regexps nil :ignore-messages nil :notification-handlers #<hash-table equal 0/65 0x500b35> :request-handlers #<hash-table equal 0/65 0x515735> :response-handlers #<hash-table eql 0/65 0x51030d> :prefix-function nil :uri-handlers #<hash-table equal 0/65 0x511335> :action-handlers #<hash-table equal 0/65 0xe57125> :major-modes (python-mode) :activation-fn nil :priority 0 :server-id pyls-remote :multi-root nil :initialization-options nil :library-folders-fn nil :before-file-open-fn nil :initialized-fn nil :remote? t :completion-in-comments? nil))
  -filter(#f(compiled-function (client) #<bytecode 0x326d589>) (#s(lsp--client :language-id nil :add-on? nil :new-connection (:connect #f(compiled-function (filter sentinel name) #<bytecode 0x2fe22a5>) :test\? #f(compiled-function () #<bytecode 0x2fe2639>)) :ignore-regexps nil :ignore-messages nil :notification-handlers #<hash-table equal 0/65 0x2817a0d> :request-handlers #<hash-table equal 0/65 0x1ded299> :response-handlers #<hash-table eql 0/65 0x2f70ebd> :prefix-function nil :uri-handlers #<hash-table equal 0/65 0x2caff41> :action-handlers #<hash-table equal 0/65 0x31069ad> :major-modes (python-mode) :activation-fn nil :priority -1 :server-id pyls :multi-root nil :initialization-options nil :library-folders-fn #f(compiled-function (workspace) #<bytecode 0x2fe1dfd>) :before-file-open-fn nil :initialized-fn #f(compiled-function (workspace) #<bytecode 0x2fe2299>) :remote? nil :completion-in-comments? nil) #s(lsp--client :language-id nil :add-on? nil :new-connection (:connect #f(compiled-function (filter sentinel name) #<bytecode 0x31c766d>) :test\? #f(compiled-function () #<bytecode 0x3175a4d>)) :ignore-regexps nil :ignore-messages nil :notification-handlers #<hash-table equal 1/65 0x31537b9> :request-handlers #<hash-table equal 0/65 0x2edf6e9> :response-handlers #<hash-table eql 0/65 0x2ee4b21> :prefix-function nil :uri-handlers #<hash-table equal 0/65 0x2ef3699> :action-handlers #<hash-table equal 1/65 0x3154bad> :major-modes (rust-mode rustic-mode) :activation-fn nil :priority -1 :server-id rls :multi-root nil :initialization-options ((omitInitBuild . t) (cmdRun . t)) :library-folders-fn #f(compiled-function (workspace) #<bytecode 0x31acb79>) :before-file-open-fn nil :initialized-fn #f(compiled-function (workspace) #<bytecode 0x322d9f5>) :remote? nil :completion-in-comments? nil) #s(lsp--client :language-id nil :add-on? nil :new-connection (:connect #f(compiled-function (filter sentinel name) #<bytecode 0x32909e1>) :test\? #f(compiled-function () #<bytecode 0x32909ed>)) :ignore-regexps nil :ignore-messages nil :notification-handlers #<hash-table equal 0/65 0x2ef92b5> :request-handlers #<hash-table equal 0/65 0x303cb51> :response-handlers #<hash-table eql 0/65 0x327a1e5> :prefix-function nil :uri-handlers #<hash-table equal 0/65 0x327b1d9> :action-handlers #<hash-table equal 0/65 0x327c1d1> :major-modes (ruby-mode enh-ruby-mode) :activation-fn nil :priority -1 :server-id ruby-ls :multi-root t :initialization-options nil :library-folders-fn nil :before-file-open-fn nil :initialized-fn #f(compiled-function (workspace) #<bytecode 0x3050fc5>) :remote? nil :completion-in-comments? nil) #s(lsp--client :language-id nil :add-on? nil :new-connection (:connect #f(compiled-function (filter sentinel name) #<bytecode 0x32b8559>) :test\? #f(compiled-function () #<bytecode 0x32b99dd>)) :ignore-regexps nil :ignore-messages nil :notification-handlers #<hash-table equal 0/65 0x327fdad> :request-handlers #<hash-table equal 0/65 0x32815b9> :response-handlers #<hash-table eql 0/65 0x32821e1> :prefix-function nil :uri-handlers #<hash-table equal 0/65 0x32831ad> :action-handlers #<hash-table equal 0/65 0x3283dd5> :major-modes (html-mode sgml-mode mhtml-mode web-mode) :activation-fn nil :priority -4 :server-id html-ls :multi-root nil :initialization-options nil :library-folders-fn nil :before-file-open-fn nil :initialized-fn #f(compiled-function (w) #<bytecode 0x32b854d>) :remote? nil :completion-in-comments? nil) #s(lsp--client :language-id nil :add-on? nil :new-connection (:connect #f(compiled-function (filter sentinel name) #<bytecode 0x3255935>) :test\? #f(compiled-function () #<bytecode 0x3255941>)) :ignore-regexps nil :ignore-messages ("readFile .*? requested by Vue but content not available") :notification-handlers #<hash-table equal 0/65 0x32879c5> :request-handlers #<hash-table equal 0/65 0x32891d9> :response-handlers #<hash-table eql 0/65 0x164a6a5> :prefix-function nil :uri-handlers #<hash-table equal 0/65 0x328a5d9> :action-handlers #<hash-table equal 0/65 0x16929c5> :major-modes nil :activation-fn #f(compiled-function (filename mode) #<bytecode 0x324fe01>) :priority -1 :server-id vls :multi-root t :initialization-options #f(compiled-function () #<bytecode 0x3250965>) :library-folders-fn nil :before-file-open-fn nil :initialized-fn #f(compiled-function (workspace) #<bytecode 0x3250971>) :remote? nil :completion-in-comments? nil) #s(lsp--client :language-id nil :add-on? nil :new-connection (:connect #f(compiled-function (filter sentinel name) #<bytecode 0x333c591>) :test\? #f(compiled-function () #<bytecode 0x333c59d>)) :ignore-regexps nil :ignore-messages nil :notification-handlers #<hash-table equal 2/65 0x328bddd> :request-handlers #<hash-table equal 0/65 0x328d9d1> :response-handlers #<hash-table eql 0/65 0x328f9b1> :prefix-function nil :uri-handlers #<hash-table equal 0/65 0x3295de1> :action-handlers #<hash-table equal 0/65 0x32975dd> :major-modes (php-mode) :activation-fn nil :priority -1 :server-id iph :multi-root t :initialization-options #f(compiled-function () #<bytecode 0x33341cd>) :library-folders-fn nil :before-file-open-fn nil :initialized-fn nil :remote? nil :completion-in-comments? nil) #s(lsp--client :language-id nil :add-on? nil :new-connection (:connect #f(compiled-function (filter sentinel name) #<bytecode 0x30e01e1>) :test\? #f(compiled-function () #<bytecode 0x30e0691>)) :ignore-regexps nil :ignore-messages nil :notification-handlers #<hash-table equal 0/65 0x32d15a1> :request-handlers #<hash-table equal 0/65 0x32d3dc5> :response-handlers #<hash-table eql 0/65 0x32dad1d> :prefix-function nil :uri-handlers #<hash-table equal 0/65 0x33191d1> :action-handlers #<hash-table equal 1/65 0x32b414d> :major-modes (css-mode less-mode less-css-mode sass-mode scss-mode) :activation-fn nil :priority -1 :server-id css-ls :multi-root nil :initialization-options nil :library-folders-fn nil :before-file-open-fn nil :initialized-fn nil :remote? nil :completion-in-comments? nil) #s(lsp--client :language-id nil :add-on? nil :new-connection (:connect #f(compiled-function (filter sentinel name) #<bytecode 0x18b94d9>) :test\? #f(compiled-function () #<bytecode 0x2828739>)) :ignore-regexps nil :ignore-messages nil :notification-handlers #<hash-table equal 0/65 0x2eadeb5> :request-handlers #<hash-table equal 0/65 0x2ccb5c1> :response-handlers #<hash-table eql 0/65 0x2ca1e99> :prefix-function nil :uri-handlers #<hash-table equal 0/65 0x2c4e8d9> :action-handlers #<hash-table equal 0/65 0x308d399> :major-modes nil :activation-fn #f(compiled-function (file-name mode) #<bytecode 0x314bcf1>) :priority 0 :server-id xmlls :multi-root nil :initialization-options nil :library-folders-fn nil :before-file-open-fn nil :initialized-fn #f(compiled-function (workspace) #<bytecode 0x33235fd>) :remote? nil :completion-in-comments? nil) #s(lsp--client :language-id nil :add-on? nil :new-connection (:connect #f(compiled-function (filter sentinel name) #<bytecode 0x2e1f599>) :test\? #f(compiled-function () #<bytecode 0x2e1f5a5>)) :ignore-regexps nil :ignore-messages nil :notification-handlers #<hash-table equal 0/65 0x2e1f50d> :request-handlers #<hash-table equal 0/65 0x2e1f4cd> :response-handlers #<hash-table eql 0/65 0x2e1f48d> :prefix-function nil :uri-handlers #<hash-table equal 0/65 0x27a5149> :action-handlers #<hash-table equal 0/65 0x27a5109> :major-modes (go-mode) :activation-fn nil :priority 0 :server-id gopls :multi-root nil :initialization-options nil :library-folders-fn #f(compiled-function (workspace) #<bytecode 0x2eaa2cd>) :before-file-open-fn nil :initialized-fn nil :remote? nil :completion-in-comments? nil) #s(lsp--client :language-id nil :add-on? nil :new-connection (:connect #f(compiled-function (filter sentinel name) #<bytecode 0x27a5061>) :test\? #f(compiled-function () #<bytecode 0x27a506d>)) :ignore-regexps nil :ignore-messages nil :notification-handlers #<hash-table equal 0/65 0x1ded1d9> :request-handlers #<hash-table equal 0/65 0x1ded199> :response-handlers #<hash-table eql 0/65 0x1ded0c1> :prefix-function nil :uri-handlers #<hash-table equal 0/65 0x1ded081> :action-handlers #<hash-table equal 0/65 0x2c8c551> :major-modes (go-mode) :activation-fn nil :priority -1 :server-id go-bingo :multi-root nil :initialization-options lsp-clients-go--make-init-options :library-folders-fn #f(compiled-function (workspace) #<bytecode 0x27a5049>) :before-file-open-fn nil :initialized-fn nil :remote? nil :completion-in-comments? nil) #s(lsp--client :language-id nil :add-on? nil :new-connection (:connect #f(compiled-function (filter sentinel name) #<bytecode 0x2ed6541>) :test\? #f(compiled-function () #<bytecode 0x2ed3d29>)) :ignore-regexps nil :ignore-messages nil :notification-handlers #<hash-table equal 0/65 0x2c90fdd> :request-handlers #<hash-table equal 0/65 0x2c90f9d> :response-handlers #<hash-table eql 0/65 0x2c90f5d> :prefix-function nil :uri-handlers #<hash-table equal 0/65 0x2c90f1d> :action-handlers #<hash-table equal 0/65 0x2c90edd> :major-modes (go-mode) :activation-fn nil :priority -2 :server-id go-ls :multi-root nil :initialization-options lsp-clients-go--make-init-options :library-folders-fn #f(compiled-function (workspace) #<bytecode 0x27a5055>) :before-file-open-fn nil :initialized-fn nil :remote? nil :completion-in-comments? nil) #s(lsp--client :language-id nil :add-on? nil :new-connection (:connect #f(compiled-function (filter sentinel name) #<bytecode 0x27f6a91>) :test\? #f(compiled-function () #<bytecode 0x2f54095>)) :ignore-regexps nil :ignore-messages nil :notification-handlers #<hash-table equal 0/65 0x27f8525> :request-handlers #<hash-table equal 0/65 0x27f84e5> :response-handlers #<hash-table eql 0/65 0x27f84a5> :prefix-function nil :uri-handlers #<hash-table equal 1/65 0x2f540a1> :action-handlers #<hash-table equal 0/65 0x27f8465> :major-modes (clojure-mode clojurec-mode clojurescript-mode) :activation-fn nil :priority 0 :server-id clojure-lsp :multi-root nil :initialization-options (:dependency-scheme "jar") :library-folders-fn nil :before-file-open-fn nil :initialized-fn nil :remote? nil :completion-in-comments? nil) #s(lsp--client :language-id nil :add-on? nil :new-connection (:connect #f(compiled-function (filter sentinel name) #<bytecode 0x100bc35>) :test\? #f(compiled-function () #<bytecode 0x2e0ebc9>)) :ignore-regexps nil :ignore-messages nil :notification-handlers #<hash-table equal 0/65 0x2e0ebd5> :request-handlers #<hash-table equal 0/65 0x32851d9> :response-handlers #<hash-table eql 0/65 0x2eaa929> :prefix-function nil :uri-handlers #<hash-table equal 0/65 0x2e0b809> :action-handlers #<hash-table equal 0/65 0x2f54115> :major-modes (dart-mode) :activation-fn nil :priority -2 :server-id dart_language_server :multi-root nil :initialization-options nil :library-folders-fn nil :before-file-open-fn nil :initialized-fn nil :remote? nil :completion-in-comments? nil) #s(lsp--client :language-id nil :add-on? nil :new-connection (:connect #f(compiled-function (filter sentinel name) #<bytecode 0x32a8201>) :test\? #f(compiled-function () #<bytecode 0x2e332e1>)) :ignore-regexps nil :ignore-messages nil :notification-handlers #<hash-table equal 0/65 0x32d6dd5> :request-handlers #<hash-table equal 0/65 0x32d951d> :response-handlers #<hash-table eql 0/65 0x13a15bd> :prefix-function nil :uri-handlers #<hash-table equal 0/65 0x1e847c5> :action-handlers #<hash-table equal 0/65 0x3fe83dd> :major-modes (dart-mode) :activation-fn nil :priority -1 :server-id dart_analysis_server :multi-root nil :initialization-options nil :library-folders-fn nil :before-file-open-fn nil :initialized-fn nil :remote? nil :completion-in-comments? nil) #s(lsp--client :language-id nil :add-on? nil :new-connection (:connect #f(compiled-function (filter sentinel name) #<bytecode 0x2e508b5>) :test\? #f(compiled-function () #<bytecode 0x28177a5>)) :ignore-regexps nil :ignore-messages nil :notification-handlers #<hash-table equal 0/65 0x284b51d> :request-handlers #<hash-table equal 0/65 0x32971b1> :response-handlers #<hash-table eql 0/65 0x27bac15> :prefix-function nil :uri-handlers #<hash-table equal 0/65 0x27bac35> :action-handlers #<hash-table equal 0/65 0x2ed00f1> :major-modes (elm-mode) :activation-fn nil :priority -1 :server-id elm-ls :multi-root nil :initialization-options lsp-clients-elm--make-init-options :library-folders-fn nil :before-file-open-fn nil :initialized-fn nil :remote? nil :completion-in-comments? nil) #s(lsp--client :language-id nil :add-on? nil :new-connection (:connect #f(compiled-function (filter sentinel name) #<bytecode 0x32d6e01>) :test\? #f(compiled-function () #<bytecode 0x33111fd>)) :ignore-regexps nil :ignore-messages nil :notification-handlers #<hash-table equal 0/65 0x32d15ed> :request-handlers #<hash-table equal 0/65 0x1e20fcd> :response-handlers #<hash-table eql 0/65 0x1e20fed> :prefix-function nil :uri-handlers #<hash-table equal 0/65 0x27f6995> :action-handlers #<hash-table equal 0/65 0x112d501> :major-modes (scala-mode) :activation-fn nil :priority -1 :server-id metals :multi-root nil :initialization-options nil :library-folders-fn nil :before-file-open-fn nil :initialized-fn #f(compiled-function (workspace) #<bytecode 0x32d6df5>) :remote? nil :completion-in-comments? nil) #s(lsp--client :language-id nil :add-on? nil :new-connection (:connect #f(compiled-function (filter sentinel name) #<bytecode 0x2e1fc39>) :test\? #f(compiled-function () #<bytecode 0x2e178c5>)) :ignore-regexps nil :ignore-messages nil :notification-handlers #<hash-table equal 4/65 0x25bd031> :request-handlers #<hash-table equal 0/65 0x2824ae1> :response-handlers #<hash-table eql 0/65 0x2ee4add> :prefix-function nil :uri-handlers #<hash-table equal 0/65 0x326b1dd> :action-handlers #<hash-table equal 0/65 0x327b9a1> :major-modes (fsharp-mode) :activation-fn nil :priority 0 :server-id fsac :multi-root nil :initialization-options lsp-fsharp--make-init-options :library-folders-fn nil :before-file-open-fn nil :initialized-fn nil :remote? nil :completion-in-comments? nil) #s(lsp--client :language-id nil :add-on? nil :new-connection (:connect #f(compiled-function (filter sentinel name) #<bytecode 0x3334a01>) :test\? #f(compiled-function () #<bytecode 0x169c925>)) :ignore-regexps nil :ignore-messages nil :notification-handlers #<hash-table equal 0/65 0x3286da1> :request-handlers #<hash-table equal 0/65 0x32929a1> :response-handlers #<hash-table eql 0/65 0x3295da1> :prefix-function nil :uri-handlers #<hash-table equal 0/65 0x18c598d> :action-handlers #<hash-table equal 0/65 0x32975a1> :major-modes (sh-mode) :activation-fn nil :priority -1 :server-id bash-ls :multi-root nil :initialization-options nil :library-folders-fn nil :before-file-open-fn nil :initialized-fn nil :remote? nil :completion-in-comments? nil) #s(lsp--client :language-id nil :add-on? nil :new-connection (:connect #f(compiled-function (filter sentinel name) #<bytecode 0x3048c15>) :test\? #f(compiled-function () #<bytecode 0x2ed50f9>)) :ignore-regexps nil :ignore-messages nil :notification-handlers #<hash-table equal 0/65 0x32959a1> :request-handlers #<hash-table equal 0/65 0x32809a1> :response-handlers #<hash-table eql 0/65 0x327a1a1> :prefix-function nil :uri-handlers #<hash-table equal 0/65 0x2ca1dc1> :action-handlers #<hash-table equal 0/65 0x2e17979> :major-modes (groovy-mode) :activation-fn nil :priority -1 :server-id groovy-ls :multi-root nil :initialization-options nil :library-folders-fn nil :before-file-open-fn nil :initialized-fn nil :remote? nil :completion-in-comments? nil) #s(lsp--client :language-id nil :add-on? nil :new-connection (:connect #f(compiled-function (filter sentinel name) #<bytecode 0x164ab81>) :test\? #f(compiled-function () #<bytecode 0x32971d1>)) :ignore-regexps nil :ignore-messages ("readFile .*? requested by TypeScript but content not available") :notification-handlers #<hash-table equal 0/65 0x27f69b5> :request-handlers #<hash-table equal 0/65 0x3ffbf7d> :response-handlers #<hash-table eql 0/65 0x1eadbd5> :prefix-function nil :uri-handlers #<hash-table equal 0/65 0x3166e65> :action-handlers #<hash-table equal 0/65 0x2e59c55> :major-modes nil :activation-fn lsp-typescript-javascript-tsx-jsx-activate-p :priority -3 :server-id jsts-ls :multi-root nil :initialization-options nil :library-folders-fn nil :before-file-open-fn nil :initialized-fn nil :remote? nil :completion-in-comments? nil) #s(lsp--client :language-id nil :add-on? nil :new-connection (:connect #f(compiled-function (filter sentinel name) #<bytecode 0x111f42d>) :test\? #f(compiled-function () #<bytecode 0x1eadbf5>)) :ignore-regexps nil :ignore-messages ("readFile .*? requested by TypeScript but content not available") :notification-handlers #<hash-table equal 0/65 0x33385a5> :request-handlers #<hash-table equal 0/65 0x33381a5> :response-handlers #<hash-table eql 0/65 0x325b1d1> :prefix-function nil :uri-handlers #<hash-table equal 0/65 0x32539d1> :action-handlers #<hash-table equal 0/65 0x32cd1a1> :major-modes nil :activation-fn lsp-typescript-javascript-tsx-jsx-activate-p :priority -2 :server-id ts-ls :multi-root nil :initialization-options nil :library-folders-fn nil :before-file-open-fn nil :initialized-fn nil :remote? nil :completion-in-comments? nil) #s(lsp--client :language-id nil :add-on? nil :new-connection (:connect #f(compiled-function (filter sentinel name) #<bytecode 0x3044ff9>) :test\? #f(compiled-function () #<bytecode 0x2ef1339>)) :ignore-regexps nil :ignore-messages nil :notification-handlers #<hash-table equal 0/65 0x2ed1ce1> :request-handlers #<hash-table equal 0/65 0x30dccad> :response-handlers #<hash-table eql 0/65 0x27b0f71> :prefix-function nil :uri-handlers #<hash-table equal 0/65 0x1016019> :action-handlers #<hash-table equal 0/65 0x10302c1> :major-modes nil :activation-fn lsp-clients-flow-activate-p :priority -1 :server-id flow-ls :multi-root nil :initialization-options nil :library-folders-fn nil :before-file-open-fn nil :initialized-fn nil :remote? nil :completion-in-comments? nil) #s(lsp--client :language-id nil :add-on? nil :new-connection (:connect #f(compiled-function (filter sentinel name) #<bytecode 0x2b1b0b5>) :test\? #f(compiled-function () #<bytecode 0x2b740e1>)) :ignore-regexps nil :ignore-messages nil :notification-handlers #<hash-table equal 0/65 0x2ca21c1> :request-handlers #<hash-table equal 0/65 0x11c8809> :response-handlers #<hash-table eql 0/65 0x132ab49> :prefix-function nil :uri-handlers #<hash-table equal 0/65 0x16ebe25> :action-handlers #<hash-table equal 0/65 0x1a1bda5> :major-modes (php-mode) :activation-fn nil :priority -2 :server-id php-ls :multi-root nil :initialization-options nil :library-folders-fn nil :before-file-open-fn nil :initialized-fn nil :remote? nil :completion-in-comments? nil) #s(lsp--client :language-id nil :add-on? nil :new-connection (:connect #f(compiled-function (filter sentinel name) #<bytecode 0x10302ed>) :test\? #f(compiled-function () #<bytecode 0x325cdcd>)) :ignore-regexps nil :ignore-messages nil :notification-handlers #<hash-table equal 0/65 0x18d6795> :request-handlers #<hash-table equal 0/65 0x2e17a69> :response-handlers #<hash-table eql 0/65 0x3045415> :prefix-function nil :uri-handlers #<hash-table equal 0/65 0x328b5c5> :action-handlers #<hash-table equal 0/65 0x317c0b5> :major-modes (reason-mode caml-mode tuareg-mode) :activation-fn nil :priority -1 :server-id ocaml-ls :multi-root nil :initialization-options nil :library-folders-fn nil :before-file-open-fn nil :initialized-fn nil :remote? nil :completion-in-comments? nil) #s(lsp--client :language-id nil :add-on? nil :new-connection (:connect #f(compiled-function (filter sentinel name) #<bytecode 0x41044a1>) :test\? #f(compiled-function () #<bytecode 0x27b0f91>)) :ignore-regexps nil :ignore-messages nil :notification-handlers #<hash-table equal 0/65 0x3293da1> :request-handlers #<hash-table equal 0/65 0x3293dc1> :response-handlers #<hash-table eql 0/65 0x41056b1> :prefix-function nil :uri-handlers #<hash-table equal 0/65 0x27f6c41> :action-handlers #<hash-table equal 0/65 0x32899c5> :major-modes (c-mode c++-mode objc-mode) :activation-fn nil :priority -1 :server-id clangd :multi-root nil :initialization-options nil :library-folders-fn nil :before-file-open-fn nil :initialized-fn nil :remote? nil :completion-in-comments? nil) #s(lsp--client :language-id nil :add-on? nil :new-connection (:connect #f(compiled-function (filter sentinel name) #<bytecode 0x32bc1d1>) :test\? #f(compiled-function () #<bytecode 0x2eb77e9>)) :ignore-regexps nil :ignore-messages nil :notification-handlers #<hash-table equal 0/65 0x1e80a29> :request-handlers #<hash-table equal 0/65 0x1e80a49> :response-handlers #<hash-table eql 0/65 0x2ca81fd> :prefix-function nil :uri-handlers #<hash-table equal 0/65 0x2ca821d> :action-handlers #<hash-table equal 0/65 0x282b151> :major-modes (elixir-mode) :activation-fn nil :priority -1 :server-id elixir-ls :multi-root nil :initialization-options nil :library-folders-fn nil :before-file-open-fn nil :initialized-fn #f(compiled-function (workspace) #<bytecode 0x1e80b45>) :remote? nil :completion-in-comments? nil) #s(lsp--client :language-id nil :add-on? nil :new-connection (:connect #f(compiled-function (filter sentinel name) #<bytecode 0x2f744ed>) :test\? #f(compiled-function () #<bytecode 0x30427e9>)) :ignore-regexps nil :ignore-messages nil :notification-handlers #<hash-table equal 0/65 0x18b4701> :request-handlers #<hash-table equal 0/65 0x18b4721> :response-handlers #<hash-table eql 0/65 0x2809df1> :prefix-function nil :uri-handlers #<hash-table equal 0/65 0x2809e11> :action-handlers #<hash-table equal 0/65 0x25f98b1> :major-modes (f90-mode fortran-mode) :activation-fn nil :priority -1 :server-id fortls :multi-root nil :initialization-options nil :library-folders-fn nil :before-file-open-fn nil :initialized-fn nil :remote? nil :completion-in-comments? nil) #s(lsp--client :language-id nil :add-on? nil :new-connection (:connect #f(compiled-function (filter sentinel name) #<bytecode 0x13587c1>) :test\? #f(compiled-function () #<bytecode 0x2c9aaa9>)) :ignore-regexps nil :ignore-messages nil :notification-handlers #<hash-table equal 0/65 0x25f98d1> :request-handlers #<hash-table equal 0/65 0x18ac0a1> :response-handlers #<hash-table eql 0/65 0x18ac0c1> :prefix-function nil :uri-handlers #<hash-table equal 0/65 0x156d651> :action-handlers #<hash-table equal 0/65 0x156d671> :major-modes (kotlin-mode) :activation-fn nil :priority -1 :server-id kotlin-ls :multi-root nil :initialization-options nil :library-folders-fn nil :before-file-open-fn nil :initialized-fn nil :remote? nil :completion-in-comments? nil) #s(lsp--client :language-id nil :add-on? nil :new-connection (:connect #f(compiled-function (filter sentinel name) #<bytecode 0x27f8721>) :test\? #f(compiled-function () #<bytecode 0x1b870b1>)) :ignore-regexps nil :ignore-messages nil :notification-handlers #<hash-table equal 2/65 0x328e5a1> :request-handlers #<hash-table equal 1/65 0x328e5c1> :response-handlers #<hash-table eql 0/65 0x328cda1> :prefix-function nil :uri-handlers #<hash-table equal 0/65 0x328cdc1> :action-handlers #<hash-table equal 0/65 0x3289da1> :major-modes (hack-mode) :activation-fn nil :priority -1 :server-id hack :multi-root nil :initialization-options nil :library-folders-fn nil :before-file-open-fn nil :initialized-fn nil :remote? nil :completion-in-comments? nil) #s(lsp--client :language-id nil :add-on? nil :new-connection (:connect #f(compiled-function (filter sentinel name) #<bytecode 0x132e7e1>) :test\? #f(compiled-function () #<bytecode 0x132e7bd>)) :ignore-regexps nil :ignore-messages nil :notification-handlers #<hash-table equal 0/65 0x500b35> :request-handlers #<hash-table equal 0/65 0x515735> :response-handlers #<hash-table eql 0/65 0x51030d> :prefix-function nil :uri-handlers #<hash-table equal 0/65 0x511335> :action-handlers #<hash-table equal 0/65 0xe57125> :major-modes (python-mode) :activation-fn nil :priority 0 :server-id pyls-remote :multi-root nil :initialization-options nil :library-folders-fn nil :before-file-open-fn nil :initialized-fn nil :remote? t :completion-in-comments? nil)))
  lsp--find-clients(python-mode "/ssh:<myserver>#12140:<some_file>.py")
  lsp--try-project-root-workspaces(nil nil)
  lsp()
  run-hooks(change-major-mode-after-body-hook prog-mode-hook python-mode-hook)
  apply(run-hooks (change-major-mode-after-body-hook prog-mode-hook python-mode-hook))
  run-mode-hooks(python-mode-hook)
  python-mode()
  set-auto-mode-0(python-mode nil)
  set-auto-mode()
  normal-mode(t)
  after-find-file(nil t)
yyoncho commented 5 years ago

Can you share your emacs version and your lsp-mode version?

Dav1d23 commented 5 years ago

emacs compiled from sources:

GNU Emacs 26.2.90 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.8) of 2019-07-01

lsp-mode lates package:

lsp-mode: 20190705.532

yyoncho commented 5 years ago

Hm, it looks like we wrongly expect executable-find to have 2 params in emacs 26.2.

Evaluating the following piece of code should fix your issue.

(defun lsp-server-present? (final-command)
  "Check whether FINAL-COMMAND is present."
  ;; executable-find only gained support for remote checks after 26.1 release
  (or (and (cond
            ((not (file-remote-p default-directory))
             (executable-find (cl-first final-command)))
            ;; ((not (version<= emacs-version "26.2"))
            ;;  (with-no-warnings (executable-find (cl-first final-command) (file-remote-p default-directory))))
            (t))
           (prog1 t
             (lsp-log "Command \"%s\" is present on the path." (s-join " " final-command))))
      (ignore (lsp-log "Command \"%s\" is not present on the path." (s-join " " final-command)))))
Dav1d23 commented 5 years ago

I update lsp-mode this morning and it seems working fine. Thanks.

ratnesh1729 commented 5 years ago

How to use virtualenv over tramp ? Exactly what setting variables to edit. Thanks