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.76k stars 875 forks source link

wrong-number-of-arguments (4 . 4) 5 #3803

Closed ns-rse closed 1 year ago

ns-rse commented 1 year ago

Thank you for the bug report

Bug description

On trying to start lsp-mode I encounter the following error...

wrong-number-of-arguments (4 . 4) 5)

Steps to reproduce

  1. Activate virtual environment
  2. Open *.py file.

Expected behavior

A few days ago lsp-mode started fine using lsp-jedi / jedi-language-server in the background.

Which Language Server did you use?

lsp-jedi-20220430.18

OS

Linux

Error callstack

Debugger entered--Lisp error: (wrong-number-of-arguments (4 . 4) 5)
  #f(compiled-function (filter sentinel name environment-fn) #<bytecode 0x1d4450e463f15f54>)((closure ((chunk) (body) (body-length) (leftovers) (body-received . 0) (workspace . #s(lsp--workspace :ewoc nil :server-capabilities nil :registered-server-capabilities nil :root "/home/neil/work/projects/claritychallenge/clarity" :client #s(lsp--client :language-id nil :add-on? nil :new-connection (:connect #f(compiled-function (filter sentinel name environment-fn) #<bytecode 0x1d4450e463f15f54>) :test\? #f(compiled-function () #<bytecode 0x1eb5f52292646b3>)) :ignore-regexps nil :ignore-messages nil :notification-handlers #<hash-table equal 0/65 0x156f87918c6f> :request-handlers #<hash-table equal 0/65 0x156f879475c3> :response-handlers #<hash-table eql 0/65 0x156f8799e7d1> :prefix-function nil :uri-handlers #<hash-table equal 0/65 0x156f879b2f8f> :action-handlers #<hash-table equal 0/65 0x156f879c15db> :major-modes (python-mode cython-mode) :activation-fn nil :priority -1 :server-id jedi :multi-root nil :initialization-options #f(compiled-function () #<bytecode 0xa27ad6e5265df9>) :semantic-tokens-faces-overrides nil :custom-capabilities nil :library-folders-fn #f(compiled-function (workspace) #<bytecode -0x47e817712b218f8>) :before-file-open-fn nil :initialized-fn nil :remote? nil :completion-in-comments? nil :path->uri-fn nil :uri->path-fn nil :environment-fn nil :after-open-fn nil :async-request-handlers #<hash-table equal 0/65 0x156f879cf697> :download-server-fn nil :download-in-progress? nil :buffers nil :synchronize-sections nil) :host-root nil :proc nil :cmd-proc nil :buffers (#<buffer evaluate.py>) :semantic-tokens-faces nil :semantic-tokens-modifier-faces nil :extra-client-capabilities nil :status starting :metadata #<hash-table equal 0/65 0x156f99b57bc7> :watches #<hash-table equal 0/65 0x156f99d5d51d> :workspace-folders nil :last-id 0 :status-string nil :shutdown-action nil :diagnostics #<hash-table equal 0/65 0x156f99d5d5c1> :work-done-tokens #<hash-table equal 0/65 0x156f99d5d5e1>)) cl-struct-lsp--log-entry-tags cl-struct-lsp-session-tags cl-struct-lsp--workspace-tags cl-struct-lsp--registered-capability-tags cl-struct-lsp--folding-range-tags cl-struct-lsp-watch-tags cl-struct-lsp--client-tags lsp--log-lines dap-ui-menu-items t) (_proc input) (setq chunk (if (s-blank\? leftovers) input (concat leftovers input))) (let (messages) (while (not (s-blank\? chunk)) (if (not body-length) (let* ((body-sep-pos ...)) (if body-sep-pos (progn ... ... ... ...) (progn ... ...))) (let* ((chunk-length ...) (left-to-receive ...) (this-body ...) (body-bytes ...)) (setq body (cons this-body body)) (setq body-received (+ body-received body-bytes)) (if (>= chunk-length left-to-receive) (progn ...))))) (mapc #'(lambda (msg) (lsp--parser-on-message msg workspace)) (nreverse messages)))) #f(compiled-function (&rest args2) #<bytecode -0xae486c77629045d>) "jedi" nil #s(lsp--workspace :ewoc nil :server-capabilities nil :registered-server-capabilities nil :root "/home/neil/work/projects/claritychallenge/clarity" :client #s(lsp--client :language-id nil :add-on? nil :new-connection (:connect #f(compiled-function (filter sentinel name environment-fn) #<bytecode 0x1d4450e463f15f54>) :test\? #f(compiled-function () #<bytecode 0x1eb5f52292646b3>)) :ignore-regexps nil :ignore-messages nil :notification-handlers #<hash-table equal 0/65 0x156f87918c6f> :request-handlers #<hash-table equal 0/65 0x156f879475c3> :response-handlers #<hash-table eql 0/65 0x156f8799e7d1> :prefix-function nil :uri-handlers #<hash-table equal 0/65 0x156f879b2f8f> :action-handlers #<hash-table equal 0/65 0x156f879c15db> :major-modes (python-mode cython-mode) :activation-fn nil :priority -1 :server-id jedi :multi-root nil :initialization-options #f(compiled-function () #<bytecode 0xa27ad6e5265df9>) :semantic-tokens-faces-overrides nil :custom-capabilities nil :library-folders-fn #f(compiled-function (workspace) #<bytecode -0x47e817712b218f8>) :before-file-open-fn nil :initialized-fn nil :remote? nil :completion-in-comments? nil :path->uri-fn nil :uri->path-fn nil :environment-fn nil :after-open-fn nil :async-request-handlers #<hash-table equal 0/65 0x156f879cf697> :download-server-fn nil :download-in-progress? nil :buffers nil :synchronize-sections nil) :host-root nil :proc nil :cmd-proc nil :buffers (#<buffer evaluate.py>) :semantic-tokens-faces nil :semantic-tokens-modifier-faces nil :extra-client-capabilities nil :status starting :metadata #<hash-table equal 0/65 0x156f99b57bc7> :watches #<hash-table equal 0/65 0x156f99d5d51d> :workspace-folders nil :last-id 0 :status-string nil :shutdown-action nil :diagnostics #<hash-table equal 0/65 0x156f99d5d5c1> :work-done-tokens #<hash-table equal 0/65 0x156f99d5d5e1>))
  funcall(#f(compiled-function (filter sentinel name environment-fn) #<bytecode 0x1d4450e463f15f54>) (closure ((chunk) (body) (body-length) (leftovers) (body-received . 0) (workspace . #s(lsp--workspace :ewoc nil :server-capabilities nil :registered-server-capabilities nil :root "/home/neil/work/projects/claritychallenge/clarity" :client #s(lsp--client :language-id nil :add-on? nil :new-connection (:connect #f(compiled-function (filter sentinel name environment-fn) #<bytecode 0x1d4450e463f15f54>) :test\? #f(compiled-function () #<bytecode 0x1eb5f52292646b3>)) :ignore-regexps nil :ignore-messages nil :notification-handlers #<hash-table equal 0/65 0x156f87918c6f> :request-handlers #<hash-table equal 0/65 0x156f879475c3> :response-handlers #<hash-table eql 0/65 0x156f8799e7d1> :prefix-function nil :uri-handlers #<hash-table equal 0/65 0x156f879b2f8f> :action-handlers #<hash-table equal 0/65 0x156f879c15db> :major-modes (python-mode cython-mode) :activation-fn nil :priority -1 :server-id jedi :multi-root nil :initialization-options #f(compiled-function () #<bytecode 0xa27ad6e5265df9>) :semantic-tokens-faces-overrides nil :custom-capabilities nil :library-folders-fn #f(compiled-function (workspace) #<bytecode -0x47e817712b218f8>) :before-file-open-fn nil :initialized-fn nil :remote? nil :completion-in-comments? nil :path->uri-fn nil :uri->path-fn nil :environment-fn nil :after-open-fn nil :async-request-handlers #<hash-table equal 0/65 0x156f879cf697> :download-server-fn nil :download-in-progress? nil :buffers nil :synchronize-sections nil) :host-root nil :proc nil :cmd-proc nil :buffers (#<buffer evaluate.py>) :semantic-tokens-faces nil :semantic-tokens-modifier-faces nil :extra-client-capabilities nil :status starting :metadata #<hash-table equal 0/65 0x156f99b57bc7> :watches #<hash-table equal 0/65 0x156f99d5d51d> :workspace-folders nil :last-id 0 :status-string nil :shutdown-action nil :diagnostics #<hash-table equal 0/65 0x156f99d5d5c1> :work-done-tokens #<hash-table equal 0/65 0x156f99d5d5e1>)) cl-struct-lsp--log-entry-tags cl-struct-lsp-session-tags cl-struct-lsp--workspace-tags cl-struct-lsp--registered-capability-tags cl-struct-lsp--folding-range-tags cl-struct-lsp-watch-tags cl-struct-lsp--client-tags lsp--log-lines dap-ui-menu-items t) (_proc input) (setq chunk (if (s-blank\? leftovers) input (concat leftovers input))) (let (messages) (while (not (s-blank\? chunk)) (if (not body-length) (let* ((body-sep-pos ...)) (if body-sep-pos (progn ... ... ... ...) (progn ... ...))) (let* ((chunk-length ...) (left-to-receive ...) (this-body ...) (body-bytes ...)) (setq body (cons this-body body)) (setq body-received (+ body-received body-bytes)) (if (>= chunk-length left-to-receive) (progn ...))))) (mapc #'(lambda (msg) (lsp--parser-on-message msg workspace)) (nreverse messages)))) #f(compiled-function (&rest args2) #<bytecode -0xae486c77629045d>) "jedi" nil #s(lsp--workspace :ewoc nil :server-capabilities nil :registered-server-capabilities nil :root "/home/neil/work/projects/claritychallenge/clarity" :client #s(lsp--client :language-id nil :add-on? nil :new-connection (:connect #f(compiled-function (filter sentinel name environment-fn) #<bytecode 0x1d4450e463f15f54>) :test\? #f(compiled-function () #<bytecode 0x1eb5f52292646b3>)) :ignore-regexps nil :ignore-messages nil :notification-handlers #<hash-table equal 0/65 0x156f87918c6f> :request-handlers #<hash-table equal 0/65 0x156f879475c3> :response-handlers #<hash-table eql 0/65 0x156f8799e7d1> :prefix-function nil :uri-handlers #<hash-table equal 0/65 0x156f879b2f8f> :action-handlers #<hash-table equal 0/65 0x156f879c15db> :major-modes (python-mode cython-mode) :activation-fn nil :priority -1 :server-id jedi :multi-root nil :initialization-options #f(compiled-function () #<bytecode 0xa27ad6e5265df9>) :semantic-tokens-faces-overrides nil :custom-capabilities nil :library-folders-fn #f(compiled-function (workspace) #<bytecode -0x47e817712b218f8>) :before-file-open-fn nil :initialized-fn nil :remote? nil :completion-in-comments? nil :path->uri-fn nil :uri->path-fn nil :environment-fn nil :after-open-fn nil :async-request-handlers #<hash-table equal 0/65 0x156f879cf697> :download-server-fn nil :download-in-progress? nil :buffers nil :synchronize-sections nil) :host-root nil :proc nil :cmd-proc nil :buffers (#<buffer evaluate.py>) :semantic-tokens-faces nil :semantic-tokens-modifier-faces nil :extra-client-capabilities nil :status starting :metadata #<hash-table equal 0/65 0x156f99b57bc7> :watches #<hash-table equal 0/65 0x156f99d5d51d> :workspace-folders nil :last-id 0 :status-string nil :shutdown-action nil :diagnostics #<hash-table equal 0/65 0x156f99d5d5c1> :work-done-tokens #<hash-table equal 0/65 0x156f99d5d5e1>))
  (let* ((default-directory root) (client (copy-lsp--client client-template)) (workspace (make-lsp--workspace :root root :client client :status 'starting :buffers (list (lsp-current-buffer)) :host-root (file-remote-p root))) (server-id (progn (or (progn (and (memq ... cl-struct-lsp--client-tags) t)) (signal 'wrong-type-argument (list 'lsp--client client))) (aref client 15))) (environment-fn (progn (or (progn (and (memq ... cl-struct-lsp--client-tags) t)) (signal 'wrong-type-argument (list 'lsp--client client))) (aref client 27))) (new-connection (progn (or (progn (and (memq ... cl-struct-lsp--client-tags) t)) (signal 'wrong-type-argument (list 'lsp--client client))) (aref client 3))) (custom-capabilities (progn (or (progn (and (memq ... cl-struct-lsp--client-tags) t)) (signal 'wrong-type-argument (list 'lsp--client client))) (aref client 19))) (multi-root (progn (or (progn (and (memq ... cl-struct-lsp--client-tags) t)) (signal 'wrong-type-argument (list 'lsp--client client))) (aref client 16))) (initialized-fn (progn (or (progn (and (memq ... cl-struct-lsp--client-tags) t)) (signal 'wrong-type-argument (list 'lsp--client client))) (aref client 22))) (--dash-source-1605-- (funcall (or (plist-get new-connection :connect) (user-error "Client %s is configured incorrectly" client)) (lsp--create-filter-function workspace) (apply-partially #'lsp--process-sentinel workspace) (format "%s" server-id) environment-fn workspace)) (proc (car-safe (prog1 --dash-source-1605-- (setq --dash-source-1605-- (cdr --dash-source-1605--))))) (cmd-proc --dash-source-1605--) (workspace-folders (gethash server-id (progn (or (progn (and ... t)) (signal 'wrong-type-argument (list ... session))) (aref session 3))))) (progn (progn (or (progn (and (memq (type-of workspace) cl-struct-lsp--workspace-tags) t)) (signal 'wrong-type-argument (list 'lsp--workspace workspace))) (let* ((v workspace)) (aset v 7 proc))) (progn (or (progn (and (memq (type-of workspace) cl-struct-lsp--workspace-tags) t)) (signal 'wrong-type-argument (list 'lsp--workspace workspace))) (let* ((v workspace)) (aset v 8 cmd-proc)))) (mapc #'(lambda (project-root) (let* ((a1 workspace) (v project-root) (v (progn ... ...))) (puthash v (let* (...) (if ... vlist ...)) v))) (or workspace-folders (list root))) (let ((lsp--cur-workspace workspace)) (run-hooks 'lsp-before-initialize-hook) (lsp-request-async "initialize" (append (list :processId nil :rootPath (lsp-file-local-name (expand-file-name root)) :clientInfo (list :name "emacs" :version (emacs-version)) :rootUri (lsp--path-to-uri root) :capabilities (lsp--client-capabilities custom-capabilities) :initializationOptions initialization-options :workDoneToken "1") (if lsp-server-trace (progn (list :trace lsp-server-trace))) (if multi-root (progn (list :workspaceFolders (apply ... ...))))) #'(lambda (input0) (let* ((capabilities ...)) (if (equal ... server-id) (progn ...)) (progn (progn ... ...) (progn ... ...)) (let (...) (lsp-notify "initialized" lsp--empty-ht)) (if initialized-fn (progn ...)) (progn (or ... ...) (let* ... ...)) (mapc #'... (progn ... ...)) (let (...) (run-hooks ...)) (lsp--info "%s initialized successfully in folders: %s" (lsp--workspace-print workspace) (lsp-workspace-folders workspace)))) :mode 'detached)) workspace)
  lsp--start-workspace(#s(lsp-session :folders ("/home/neil/work/code_clinic" "/home/neil/org-roam" "/home/neil/work/RSECon/2022/pnumpy/PythonHPC/noteb..." "/home/neil/work/ns-rse.github.io" "/home/neil/.virtualenvs/topostats/lib/python3.10/s..." "/home/neil/work/projects/claritychallenge/clarity" "/home/neil/dotfiles" "/tmp" "/home/neil/org" "/home/neil/work/org-roam" "/home/neil/work/org" "/home/neil/work/projects/pgfinder" "/home/neil/work/templates/python/package" "/home/neil/work/templates/python/package/package" "/home/neil/work/projects/pgfinder/pgfinder" "/home/neil/work/meetings/fluff-removal" "/home/neil/work/teaching/python-calculator" "/home/neil/tmp" "/home/neil/tmp/TopoStats" "/home/neil/org/rse" "/home/neil/work/projects/topostats") :folders-blacklist ("/home/neil/.virtualenvs/default/lib/python3.10/sit...") :server-id->folders #<hash-table equal 0/65 0x156f87bcdb2f> :folder->servers #<hash-table equal 0/65 0x156f87bcdb4f> :metadata #<hash-table equal 0/65 0x156f8806c779>) #s(lsp--client :language-id nil :add-on? nil :new-connection (:connect #f(compiled-function (filter sentinel name environment-fn) #<bytecode 0x1d4450e463f15f54>) :test\? #f(compiled-function () #<bytecode 0x1eb5f52292646b3>)) :ignore-regexps nil :ignore-messages nil :notification-handlers #<hash-table equal 0/65 0x156f87918c6f> :request-handlers #<hash-table equal 0/65 0x156f879475c3> :response-handlers #<hash-table eql 0/65 0x156f8799e7d1> :prefix-function nil :uri-handlers #<hash-table equal 0/65 0x156f879b2f8f> :action-handlers #<hash-table equal 0/65 0x156f879c15db> :major-modes (python-mode cython-mode) :activation-fn nil :priority -1 :server-id jedi :multi-root nil :initialization-options #f(compiled-function () #<bytecode 0xa27ad6e5265df9>) :semantic-tokens-faces-overrides nil :custom-capabilities nil :library-folders-fn #f(compiled-function (workspace) #<bytecode -0x47e817712b218f8>) :before-file-open-fn nil :initialized-fn nil :remote? nil :completion-in-comments? nil :path->uri-fn nil :uri->path-fn nil :environment-fn nil :after-open-fn nil :async-request-handlers #<hash-table equal 0/65 0x156f879cf697> :download-server-fn nil :download-in-progress? nil :buffers nil :synchronize-sections nil) "/home/neil/work/projects/claritychallenge/clarity" #<hash-table equal 9/65 0x156f9b0bdaad>)
  (unwind-protect (lsp--start-workspace session client project-root (lsp--create-initialization-options session client)) (lsp--spinner-stop))
  lsp--start-connection(#s(lsp-session :folders ("/home/neil/work/code_clinic" "/home/neil/org-roam" "/home/neil/work/RSECon/2022/pnumpy/PythonHPC/noteb..." "/home/neil/work/ns-rse.github.io" "/home/neil/.virtualenvs/topostats/lib/python3.10/s..." "/home/neil/work/projects/claritychallenge/clarity" "/home/neil/dotfiles" "/tmp" "/home/neil/org" "/home/neil/work/org-roam" "/home/neil/work/org" "/home/neil/work/projects/pgfinder" "/home/neil/work/templates/python/package" "/home/neil/work/templates/python/package/package" "/home/neil/work/projects/pgfinder/pgfinder" "/home/neil/work/meetings/fluff-removal" "/home/neil/work/teaching/python-calculator" "/home/neil/tmp" "/home/neil/tmp/TopoStats" "/home/neil/org/rse" "/home/neil/work/projects/topostats") :folders-blacklist ("/home/neil/.virtualenvs/default/lib/python3.10/sit...") :server-id->folders #<hash-table equal 0/65 0x156f87bcdb2f> :folder->servers #<hash-table equal 0/65 0x156f87bcdb4f> :metadata #<hash-table equal 0/65 0x156f8806c779>) #s(lsp--client :language-id nil :add-on? nil :new-connection (:connect #f(compiled-function (filter sentinel name environment-fn) #<bytecode 0x1d4450e463f15f54>) :test\? #f(compiled-function () #<bytecode 0x1eb5f52292646b3>)) :ignore-regexps nil :ignore-messages nil :notification-handlers #<hash-table equal 0/65 0x156f87918c6f> :request-handlers #<hash-table equal 0/65 0x156f879475c3> :response-handlers #<hash-table eql 0/65 0x156f8799e7d1> :prefix-function nil :uri-handlers #<hash-table equal 0/65 0x156f879b2f8f> :action-handlers #<hash-table equal 0/65 0x156f879c15db> :major-modes (python-mode cython-mode) :activation-fn nil :priority -1 :server-id jedi :multi-root nil :initialization-options #f(compiled-function () #<bytecode 0xa27ad6e5265df9>) :semantic-tokens-faces-overrides nil :custom-capabilities nil :library-folders-fn #f(compiled-function (workspace) #<bytecode -0x47e817712b218f8>) :before-file-open-fn nil :initialized-fn nil :remote? nil :completion-in-comments? nil :path->uri-fn nil :uri->path-fn nil :environment-fn nil :after-open-fn nil :async-request-handlers #<hash-table equal 0/65 0x156f879cf697> :download-server-fn nil :download-in-progress? nil :buffers nil :synchronize-sections nil) "/home/neil/work/projects/claritychallenge/clarity")
  (or (lsp--find-workspace session client project-root) (if ignore-multi-folder nil (lsp--find-multiroot-workspace session client project-root)) (lsp--start-connection session client project-root))
  (closure ((ignore-multi-folder) (project-root . "/home/neil/work/projects/clar...") (clients #s(lsp--client :language-id nil :add-on? nil :new-connection ... :ignore-regexps nil :ignore-messages nil :notification-handlers #<hash-table equal 0/65 0x156f87918c6f> :request-handlers #<hash-table equal 0/65 0x156f879475c3> :response-handlers #<hash-table eql 0/65 0x156f8799e7d1> :prefix-function nil :uri-handlers #<hash-table equal 0/65 0x156f879b2f8f> :action-handlers #<hash-table equal 0/65 0x156f879c15db> :major-modes ... :activation-fn nil :priority -1 :server-id jedi :multi-root nil :initialization-options #f(compiled-function () #<bytecode 0xa27ad6e5265df9>) :semantic-tokens-faces-overrides nil :custom-capabilities nil :library-folders-fn #f(compiled-function (workspace) #<bytecode -0x47e817712b218f8>) :before-file-open-fn nil :initialized-fn nil :remote? nil :completion-in-comments? nil :path->uri-fn nil :uri->path-fn nil :environment-fn nil :after-open-fn nil :async-request-handlers #<hash-table equal 0/65 0x156f879cf697> ...)) (session . #s(lsp-session :folders ... :folders-blacklist ... :server-id->folders #<hash-table equal 0/65 0x156f87bcdb2f> :folder->servers #<hash-table equal 0/65 0x156f87bcdb4f> :metadata #<hash-table equal 0/65 0x156f8806c779>)) cl-struct-lsp--log-entry-tags cl-struct-lsp-session-tags cl-struct-lsp--workspace-tags cl-struct-lsp--registered-capability-tags cl-struct-lsp--folding-range-tags cl-struct-lsp-watch-tags cl-struct-lsp--client-tags lsp--log-lines dap-ui-menu-items t) (client) (or (lsp--find-workspace session client project-root) (if ignore-multi-folder nil (lsp--find-multiroot-workspace session client project-root)) (lsp--start-connection session client project-root)))(#s(lsp--client :language-id nil :add-on? nil :new-connection (:connect #f(compiled-function (filter sentinel name environment-fn) #<bytecode 0x1d4450e463f15f54>) :test\? #f(compiled-function () #<bytecode 0x1eb5f52292646b3>)) :ignore-regexps nil :ignore-messages nil :notification-handlers #<hash-table equal 0/65 0x156f87918c6f> :request-handlers #<hash-table equal 0/65 0x156f879475c3> :response-handlers #<hash-table eql 0/65 0x156f8799e7d1> :prefix-function nil :uri-handlers #<hash-table equal 0/65 0x156f879b2f8f> :action-handlers #<hash-table equal 0/65 0x156f879c15db> :major-modes (python-mode cython-mode) :activation-fn nil :priority -1 :server-id jedi :multi-root nil :initialization-options #f(compiled-function () #<bytecode 0xa27ad6e5265df9>) :semantic-tokens-faces-overrides nil :custom-capabilities nil :library-folders-fn #f(compiled-function (workspace) #<bytecode -0x47e817712b218f8>) :before-file-open-fn nil :initialized-fn nil :remote? nil :completion-in-comments? nil :path->uri-fn nil :uri->path-fn nil :environment-fn nil :after-open-fn nil :async-request-handlers #<hash-table equal 0/65 0x156f879cf697> :download-server-fn nil :download-in-progress? nil :buffers nil :synchronize-sections nil))
  mapcar((closure ((ignore-multi-folder) (project-root . "/home/neil/work/projects/claritychallenge/clarity") (clients #s(lsp--client :language-id nil :add-on? nil :new-connection (:connect #f(compiled-function (filter sentinel name environment-fn) #<bytecode 0x1d4450e463f15f54>) :test\? #f(compiled-function () #<bytecode 0x1eb5f52292646b3>)) :ignore-regexps nil :ignore-messages nil :notification-handlers #<hash-table equal 0/65 0x156f87918c6f> :request-handlers #<hash-table equal 0/65 0x156f879475c3> :response-handlers #<hash-table eql 0/65 0x156f8799e7d1> :prefix-function nil :uri-handlers #<hash-table equal 0/65 0x156f879b2f8f> :action-handlers #<hash-table equal 0/65 0x156f879c15db> :major-modes (python-mode cython-mode) :activation-fn nil :priority -1 :server-id jedi :multi-root nil :initialization-options #f(compiled-function () #<bytecode 0xa27ad6e5265df9>) :semantic-tokens-faces-overrides nil :custom-capabilities nil :library-folders-fn #f(compiled-function (workspace) #<bytecode -0x47e817712b218f8>) :before-file-open-fn nil :initialized-fn nil :remote? nil :completion-in-comments? nil :path->uri-fn nil :uri->path-fn nil :environment-fn nil :after-open-fn nil :async-request-handlers #<hash-table equal 0/65 0x156f879cf697> :download-server-fn nil :download-in-progress? nil :buffers nil :synchronize-sections nil)) (session . #s(lsp-session :folders ("/home/neil/work/code_clinic" "/home/neil/org-roam" "/home/neil/work/RSECon/2022/pnumpy/PythonHPC/noteb..." "/home/neil/work/ns-rse.github.io" "/home/neil/.virtualenvs/topostats/lib/python3.10/s..." "/home/neil/work/projects/claritychallenge/clarity" "/home/neil/dotfiles" "/tmp" "/home/neil/org" "/home/neil/work/org-roam" "/home/neil/work/org" "/home/neil/work/projects/pgfinder" "/home/neil/work/templates/python/package" "/home/neil/work/templates/python/package/package" "/home/neil/work/projects/pgfinder/pgfinder" "/home/neil/work/meetings/fluff-removal" "/home/neil/work/teaching/python-calculator" "/home/neil/tmp" "/home/neil/tmp/TopoStats" "/home/neil/org/rse" "/home/neil/work/projects/topostats") :folders-blacklist ("/home/neil/.virtualenvs/default/lib/python3.10/sit...") :server-id->folders #<hash-table equal 0/65 0x156f87bcdb2f> :folder->servers #<hash-table equal 0/65 0x156f87bcdb4f> :metadata #<hash-table equal 0/65 0x156f8806c779>)) cl-struct-lsp--log-entry-tags cl-struct-lsp-session-tags cl-struct-lsp--workspace-tags cl-struct-lsp--registered-capability-tags cl-struct-lsp--folding-range-tags cl-struct-lsp-watch-tags cl-struct-lsp--client-tags lsp--log-lines dap-ui-menu-items t) (client) (or (lsp--find-workspace session client project-root) (if ignore-multi-folder nil (lsp--find-multiroot-workspace session client project-root)) (lsp--start-connection session client project-root))) (#s(lsp--client :language-id nil :add-on? nil :new-connection (:connect #f(compiled-function (filter sentinel name environment-fn) #<bytecode 0x1d4450e463f15f54>) :test\? #f(compiled-function () #<bytecode 0x1eb5f52292646b3>)) :ignore-regexps nil :ignore-messages nil :notification-handlers #<hash-table equal 0/65 0x156f87918c6f> :request-handlers #<hash-table equal 0/65 0x156f879475c3> :response-handlers #<hash-table eql 0/65 0x156f8799e7d1> :prefix-function nil :uri-handlers #<hash-table equal 0/65 0x156f879b2f8f> :action-handlers #<hash-table equal 0/65 0x156f879c15db> :major-modes (python-mode cython-mode) :activation-fn nil :priority -1 :server-id jedi :multi-root nil :initialization-options #f(compiled-function () #<bytecode 0xa27ad6e5265df9>) :semantic-tokens-faces-overrides nil :custom-capabilities nil :library-folders-fn #f(compiled-function (workspace) #<bytecode -0x47e817712b218f8>) :before-file-open-fn nil :initialized-fn nil :remote? nil :completion-in-comments? nil :path->uri-fn nil :uri->path-fn nil :environment-fn nil :after-open-fn nil :async-request-handlers #<hash-table equal 0/65 0x156f879cf697> :download-server-fn nil :download-in-progress? nil :buffers nil :synchronize-sections nil)))
  -map((closure ((ignore-multi-folder) (project-root . "/home/neil/work/projects/claritychallenge/clarity") (clients #s(lsp--client :language-id nil :add-on? nil :new-connection (:connect #f(compiled-function (filter sentinel name environment-fn) #<bytecode 0x1d4450e463f15f54>) :test\? #f(compiled-function () #<bytecode 0x1eb5f52292646b3>)) :ignore-regexps nil :ignore-messages nil :notification-handlers #<hash-table equal 0/65 0x156f87918c6f> :request-handlers #<hash-table equal 0/65 0x156f879475c3> :response-handlers #<hash-table eql 0/65 0x156f8799e7d1> :prefix-function nil :uri-handlers #<hash-table equal 0/65 0x156f879b2f8f> :action-handlers #<hash-table equal 0/65 0x156f879c15db> :major-modes (python-mode cython-mode) :activation-fn nil :priority -1 :server-id jedi :multi-root nil :initialization-options #f(compiled-function () #<bytecode 0xa27ad6e5265df9>) :semantic-tokens-faces-overrides nil :custom-capabilities nil :library-folders-fn #f(compiled-function (workspace) #<bytecode -0x47e817712b218f8>) :before-file-open-fn nil :initialized-fn nil :remote? nil :completion-in-comments? nil :path->uri-fn nil :uri->path-fn nil :environment-fn nil :after-open-fn nil :async-request-handlers #<hash-table equal 0/65 0x156f879cf697> :download-server-fn nil :download-in-progress? nil :buffers nil :synchronize-sections nil)) (session . #s(lsp-session :folders ("/home/neil/work/code_clinic" "/home/neil/org-roam" "/home/neil/work/RSECon/2022/pnumpy/PythonHPC/noteb..." "/home/neil/work/ns-rse.github.io" "/home/neil/.virtualenvs/topostats/lib/python3.10/s..." "/home/neil/work/projects/claritychallenge/clarity" "/home/neil/dotfiles" "/tmp" "/home/neil/org" "/home/neil/work/org-roam" "/home/neil/work/org" "/home/neil/work/projects/pgfinder" "/home/neil/work/templates/python/package" "/home/neil/work/templates/python/package/package" "/home/neil/work/projects/pgfinder/pgfinder" "/home/neil/work/meetings/fluff-removal" "/home/neil/work/teaching/python-calculator" "/home/neil/tmp" "/home/neil/tmp/TopoStats" "/home/neil/org/rse" "/home/neil/work/projects/topostats") :folders-blacklist ("/home/neil/.virtualenvs/default/lib/python3.10/sit...") :server-id->folders #<hash-table equal 0/65 0x156f87bcdb2f> :folder->servers #<hash-table equal 0/65 0x156f87bcdb4f> :metadata #<hash-table equal 0/65 0x156f8806c779>)) cl-struct-lsp--log-entry-tags cl-struct-lsp-session-tags cl-struct-lsp--workspace-tags cl-struct-lsp--registered-capability-tags cl-struct-lsp--folding-range-tags cl-struct-lsp-watch-tags cl-struct-lsp--client-tags lsp--log-lines dap-ui-menu-items t) (client) (or (lsp--find-workspace session client project-root) (if ignore-multi-folder nil (lsp--find-multiroot-workspace session client project-root)) (lsp--start-connection session client project-root))) (#s(lsp--client :language-id nil :add-on? nil :new-connection (:connect #f(compiled-function (filter sentinel name environment-fn) #<bytecode 0x1d4450e463f15f54>) :test\? #f(compiled-function () #<bytecode 0x1eb5f52292646b3>)) :ignore-regexps nil :ignore-messages nil :notification-handlers #<hash-table equal 0/65 0x156f87918c6f> :request-handlers #<hash-table equal 0/65 0x156f879475c3> :response-handlers #<hash-table eql 0/65 0x156f8799e7d1> :prefix-function nil :uri-handlers #<hash-table equal 0/65 0x156f879b2f8f> :action-handlers #<hash-table equal 0/65 0x156f879c15db> :major-modes (python-mode cython-mode) :activation-fn nil :priority -1 :server-id jedi :multi-root nil :initialization-options #f(compiled-function () #<bytecode 0xa27ad6e5265df9>) :semantic-tokens-faces-overrides nil :custom-capabilities nil :library-folders-fn #f(compiled-function (workspace) #<bytecode -0x47e817712b218f8>) :before-file-open-fn nil :initialized-fn nil :remote? nil :completion-in-comments? nil :path->uri-fn nil :uri->path-fn nil :environment-fn nil :after-open-fn nil :async-request-handlers #<hash-table equal 0/65 0x156f879cf697> :download-server-fn nil :download-in-progress? nil :buffers nil :synchronize-sections nil)))
  lsp--ensure-lsp-servers(#s(lsp-session :folders ("/home/neil/work/code_clinic" "/home/neil/org-roam" "/home/neil/work/RSECon/2022/pnumpy/PythonHPC/noteb..." "/home/neil/work/ns-rse.github.io" "/home/neil/.virtualenvs/topostats/lib/python3.10/s..." "/home/neil/work/projects/claritychallenge/clarity" "/home/neil/dotfiles" "/tmp" "/home/neil/org" "/home/neil/work/org-roam" "/home/neil/work/org" "/home/neil/work/projects/pgfinder" "/home/neil/work/templates/python/package" "/home/neil/work/templates/python/package/package" "/home/neil/work/projects/pgfinder/pgfinder" "/home/neil/work/meetings/fluff-removal" "/home/neil/work/teaching/python-calculator" "/home/neil/tmp" "/home/neil/tmp/TopoStats" "/home/neil/org/rse" "/home/neil/work/projects/topostats") :folders-blacklist ("/home/neil/.virtualenvs/default/lib/python3.10/sit...") :server-id->folders #<hash-table equal 0/65 0x156f87bcdb2f> :folder->servers #<hash-table equal 0/65 0x156f87bcdb4f> :metadata #<hash-table equal 0/65 0x156f8806c779>) (#s(lsp--client :language-id nil :add-on? nil :new-connection (:connect #f(compiled-function (filter sentinel name environment-fn) #<bytecode 0x1d4450e463f15f54>) :test\? #f(compiled-function () #<bytecode 0x1eb5f52292646b3>)) :ignore-regexps nil :ignore-messages nil :notification-handlers #<hash-table equal 0/65 0x156f87918c6f> :request-handlers #<hash-table equal 0/65 0x156f879475c3> :response-handlers #<hash-table eql 0/65 0x156f8799e7d1> :prefix-function nil :uri-handlers #<hash-table equal 0/65 0x156f879b2f8f> :action-handlers #<hash-table equal 0/65 0x156f879c15db> :major-modes (python-mode cython-mode) :activation-fn nil :priority -1 :server-id jedi :multi-root nil :initialization-options #f(compiled-function () #<bytecode 0xa27ad6e5265df9>) :semantic-tokens-faces-overrides nil :custom-capabilities nil :library-folders-fn #f(compiled-function (workspace) #<bytecode -0x47e817712b218f8>) :before-file-open-fn nil :initialized-fn nil :remote? nil :completion-in-comments? nil :path->uri-fn nil :uri->path-fn nil :environment-fn nil :after-open-fn nil :async-request-handlers #<hash-table equal 0/65 0x156f879cf697> :download-server-fn nil :download-in-progress? nil :buffers nil :synchronize-sections nil)) "/home/neil/work/projects/claritychallenge/clarity" nil)
  (progn (if (-contains\? (progn (or (progn (and (memq ... cl-struct-lsp-session-tags) t)) (signal 'wrong-type-argument (list 'lsp-session session))) (aref session 1)) project-root) nil (progn (or (progn (and (memq (type-of session) cl-struct-lsp-session-tags) t)) (signal 'wrong-type-argument (list 'lsp-session session))) (let* ((v session)) (aset v 1 (let* ((vlist ...)) (if (memql project-root vlist) vlist (cons project-root vlist)))))) (lsp--persist-session session)) (lsp--ensure-lsp-servers session clients project-root ignore-multi-folder))
  (if project-root (progn (if (-contains\? (progn (or (progn (and ... t)) (signal 'wrong-type-argument (list ... session))) (aref session 1)) project-root) nil (progn (or (progn (and (memq ... cl-struct-lsp-session-tags) t)) (signal 'wrong-type-argument (list 'lsp-session session))) (let* ((v session)) (aset v 1 (let* (...) (if ... vlist ...))))) (lsp--persist-session session)) (lsp--ensure-lsp-servers session clients project-root ignore-multi-folder)) (lsp--warn "%s not in project or it is blacklisted." (buffer-name)) nil)
  (let ((project-root (let ((result (let (...) (if result ...)))) (if result (progn (lsp-f-canonical result)))))) (if project-root (progn (if (-contains\? (progn (or (progn ...) (signal ... ...)) (aref session 1)) project-root) nil (progn (or (progn (and ... t)) (signal 'wrong-type-argument (list ... session))) (let* ((v session)) (aset v 1 (let* ... ...)))) (lsp--persist-session session)) (lsp--ensure-lsp-servers session clients project-root ignore-multi-folder)) (lsp--warn "%s not in project or it is blacklisted." (buffer-name)) nil))
  (if clients (let ((project-root (let ((result (let ... ...))) (if result (progn (lsp-f-canonical result)))))) (if project-root (progn (if (-contains\? (progn (or ... ...) (aref session 1)) project-root) nil (progn (or (progn ...) (signal ... ...)) (let* (...) (aset v 1 ...))) (lsp--persist-session session)) (lsp--ensure-lsp-servers session clients project-root ignore-multi-folder)) (lsp--warn "%s not in project or it is blacklisted." (buffer-name)) nil)) (lsp--warn "No LSP server for %s(check *lsp-log*)." major-mode) nil)
  (let ((clients (if ask-for-client (list (lsp--completing-read "Select server to start: " (ht-values lsp-clients) (-compose 'symbol-name 'lsp--client-server-id) nil t)) (lsp--find-clients)))) (if clients (let ((project-root (let ((result ...)) (if result (progn ...))))) (if project-root (progn (if (-contains\? (progn ... ...) project-root) nil (progn (or ... ...) (let* ... ...)) (lsp--persist-session session)) (lsp--ensure-lsp-servers session clients project-root ignore-multi-folder)) (lsp--warn "%s not in project or it is blacklisted." (buffer-name)) nil)) (lsp--warn "No LSP server for %s(check *lsp-log*)." major-mode) nil))
  (let* ((session input0)) (let ((clients (if ask-for-client (list (lsp--completing-read "Select server to start: " (ht-values lsp-clients) (-compose ... ...) nil t)) (lsp--find-clients)))) (if clients (let ((project-root (let (...) (if result ...)))) (if project-root (progn (if (-contains\? ... project-root) nil (progn ... ...) (lsp--persist-session session)) (lsp--ensure-lsp-servers session clients project-root ignore-multi-folder)) (lsp--warn "%s not in project or it is blacklisted." (buffer-name)) nil)) (lsp--warn "No LSP server for %s(check *lsp-log*)." major-mode) nil)))
  (let ((input0 (lsp-session))) (let* ((session input0)) (let ((clients (if ask-for-client (list (lsp--completing-read "Select server to start: " ... ... nil t)) (lsp--find-clients)))) (if clients (let ((project-root (let ... ...))) (if project-root (progn (if ... nil ... ...) (lsp--ensure-lsp-servers session clients project-root ignore-multi-folder)) (lsp--warn "%s not in project or it is blacklisted." (buffer-name)) nil)) (lsp--warn "No LSP server for %s(check *lsp-log*)." major-mode) nil))))
  lsp--try-project-root-workspaces(nil nil)
  (or (and (not (lsp-find-session-folder (lsp-session) (buffer-file-name))) (lsp--try-open-in-library-workspace)) (lsp--try-project-root-workspaces (equal arg '(4)) (and arg (not (equal arg 1)))))
  (setq lsp--buffer-workspaces (or (and (not (lsp-find-session-folder (lsp-session) (buffer-file-name))) (lsp--try-open-in-library-workspace)) (lsp--try-project-root-workspaces (equal arg '(4)) (and arg (not (equal arg 1))))))
  (if (setq lsp--buffer-workspaces (or (and (not (lsp-find-session-folder (lsp-session) (buffer-file-name))) (lsp--try-open-in-library-workspace)) (lsp--try-project-root-workspaces (equal arg '(4)) (and arg (not (equal arg 1)))))) (progn (lsp-mode 1) (if lsp-auto-configure (progn (lsp--auto-configure))) (setq lsp-buffer-uri (lsp--buffer-uri)) (lsp--info "Connected to %s." (apply 'concat (mapcar #'(lambda (it) (ignore it) (format "[%s %s]" ... ...)) lsp--buffer-workspaces)))))
  (cond (matching-clients (if (setq lsp--buffer-workspaces (or (and (not (lsp-find-session-folder ... ...)) (lsp--try-open-in-library-workspace)) (lsp--try-project-root-workspaces (equal arg '...) (and arg (not ...))))) (progn (lsp-mode 1) (if lsp-auto-configure (progn (lsp--auto-configure))) (setq lsp-buffer-uri (lsp--buffer-uri)) (lsp--info "Connected to %s." (apply 'concat (mapcar #'... lsp--buffer-workspaces)))))) ((setq clients (lsp--filter-clients (-andfn #'lsp--supports-buffer\? #'lsp--client-download-in-progress\?))) (lsp--info "There are language server(%s) installation in prog..." (-map #'lsp--client-server-id clients)) (seq-do #'(lambda (client) (progn (or (progn ...) (signal ... ...)) (let* (...) (aset v 32 ...)))) clients)) ((setq clients (lsp--filter-clients (-andfn #'lsp--supports-buffer\? (-const lsp-enable-suggest-server-download) #'lsp--client-download-server-fn (-not #'lsp--client-download-in-progress\?)))) (let ((client (lsp--completing-read (concat "Unable to find installed server supporting this fi..." "The following servers could be installed automatic...") clients (-compose #'symbol-name #'lsp--client-server-id) nil t))) (progn (or (progn (and (memq ... cl-struct-lsp--client-tags) t)) (signal 'wrong-type-argument (list 'lsp--client client))) (let* ((v client)) (aset v 32 (let* (... ...) (if ... vlist ...))))) (lsp--install-server-internal client))) ((setq clients (if matching-clients nil (lsp--filter-clients (-andfn #'lsp--supports-buffer\? #'lsp--client-download-server-fn (-not (-const lsp-enable-suggest-server-download)) (-not #'lsp--server-binary-present\?))))) (lsp--warn "The following servers support current file but aut..." (mapconcat #'(lambda (client) (symbol-name (progn ... ...))) clients " "))) ((setq clients (if matching-clients nil (lsp--filter-clients (-andfn #'lsp--supports-buffer\? (-not #'lsp--server-binary-present\?))))) (lsp--warn "The following servers support current file but do ..." (mapconcat #'(lambda (client) (symbol-name (progn ... ...))) clients " "))) ((and lsp-warn-no-matched-clients (not (lsp--filter-clients #'lsp--supports-buffer\?))) (lsp--error "There are no language servers supporting current m..." major-mode major-mode major-mode)))
  (let (clients (matching-clients (lsp--filter-clients (-andfn #'lsp--supports-buffer\? #'lsp--server-binary-present\?)))) (cond (matching-clients (if (setq lsp--buffer-workspaces (or (and (not ...) (lsp--try-open-in-library-workspace)) (lsp--try-project-root-workspaces (equal arg ...) (and arg ...)))) (progn (lsp-mode 1) (if lsp-auto-configure (progn (lsp--auto-configure))) (setq lsp-buffer-uri (lsp--buffer-uri)) (lsp--info "Connected to %s." (apply 'concat (mapcar ... lsp--buffer-workspaces)))))) ((setq clients (lsp--filter-clients (-andfn #'lsp--supports-buffer\? #'lsp--client-download-in-progress\?))) (lsp--info "There are language server(%s) installation in prog..." (-map #'lsp--client-server-id clients)) (seq-do #'(lambda (client) (progn (or ... ...) (let* ... ...))) clients)) ((setq clients (lsp--filter-clients (-andfn #'lsp--supports-buffer\? (-const lsp-enable-suggest-server-download) #'lsp--client-download-server-fn (-not #'lsp--client-download-in-progress\?)))) (let ((client (lsp--completing-read (concat "Unable to find installed server supporting this fi..." "The following servers could be installed automatic...") clients (-compose ... ...) nil t))) (progn (or (progn (and ... t)) (signal 'wrong-type-argument (list ... client))) (let* ((v client)) (aset v 32 (let* ... ...)))) (lsp--install-server-internal client))) ((setq clients (if matching-clients nil (lsp--filter-clients (-andfn #'lsp--supports-buffer\? #'lsp--client-download-server-fn (-not ...) (-not ...))))) (lsp--warn "The following servers support current file but aut..." (mapconcat #'(lambda (client) (symbol-name ...)) clients " "))) ((setq clients (if matching-clients nil (lsp--filter-clients (-andfn #'lsp--supports-buffer\? (-not ...))))) (lsp--warn "The following servers support current file but do ..." (mapconcat #'(lambda (client) (symbol-name ...)) clients " "))) ((and lsp-warn-no-matched-clients (not (lsp--filter-clients #'lsp--supports-buffer\?))) (lsp--error "There are no language servers supporting current m..." major-mode major-mode major-mode))))
  (progn (let (clients (matching-clients (lsp--filter-clients (-andfn #'lsp--supports-buffer\? #'lsp--server-binary-present\?)))) (cond (matching-clients (if (setq lsp--buffer-workspaces (or (and ... ...) (lsp--try-project-root-workspaces ... ...))) (progn (lsp-mode 1) (if lsp-auto-configure (progn ...)) (setq lsp-buffer-uri (lsp--buffer-uri)) (lsp--info "Connected to %s." (apply ... ...))))) ((setq clients (lsp--filter-clients (-andfn #'lsp--supports-buffer\? #'lsp--client-download-in-progress\?))) (lsp--info "There are language server(%s) installation in prog..." (-map #'lsp--client-server-id clients)) (seq-do #'(lambda (client) (progn ... ...)) clients)) ((setq clients (lsp--filter-clients (-andfn #'lsp--supports-buffer\? (-const lsp-enable-suggest-server-download) #'lsp--client-download-server-fn (-not ...)))) (let ((client (lsp--completing-read ... clients ... nil t))) (progn (or (progn ...) (signal ... ...)) (let* (...) (aset v 32 ...))) (lsp--install-server-internal client))) ((setq clients (if matching-clients nil (lsp--filter-clients (-andfn ... ... ... ...)))) (lsp--warn "The following servers support current file but aut..." (mapconcat #'(lambda ... ...) clients " "))) ((setq clients (if matching-clients nil (lsp--filter-clients (-andfn ... ...)))) (lsp--warn "The following servers support current file but do ..." (mapconcat #'(lambda ... ...) clients " "))) ((and lsp-warn-no-matched-clients (not (lsp--filter-clients #'lsp--supports-buffer\?))) (lsp--error "There are no language servers supporting current m..." major-mode major-mode major-mode)))))
  (if (buffer-file-name) (progn (let (clients (matching-clients (lsp--filter-clients (-andfn #'lsp--supports-buffer\? #'lsp--server-binary-present\?)))) (cond (matching-clients (if (setq lsp--buffer-workspaces (or ... ...)) (progn (lsp-mode 1) (if lsp-auto-configure ...) (setq lsp-buffer-uri ...) (lsp--info "Connected to %s." ...)))) ((setq clients (lsp--filter-clients (-andfn ... ...))) (lsp--info "There are language server(%s) installation in prog..." (-map #'lsp--client-server-id clients)) (seq-do #'(lambda ... ...) clients)) ((setq clients (lsp--filter-clients (-andfn ... ... ... ...))) (let ((client ...)) (progn (or ... ...) (let* ... ...)) (lsp--install-server-internal client))) ((setq clients (if matching-clients nil (lsp--filter-clients ...))) (lsp--warn "The following servers support current file but aut..." (mapconcat #'... clients " "))) ((setq clients (if matching-clients nil (lsp--filter-clients ...))) (lsp--warn "The following servers support current file but do ..." (mapconcat #'... clients " "))) ((and lsp-warn-no-matched-clients (not (lsp--filter-clients ...))) (lsp--error "There are no language servers supporting current m..." major-mode major-mode major-mode))))))
  lsp()
  (progn (lsp))
  (if (and lsp-mode (not lsp--buffer-workspaces)) (progn (lsp)))
  (let ((last-message (current-message))) (setq lsp-mode (cond ((eq arg 'toggle) (not lsp-mode)) ((and (numberp arg) (< arg 1)) nil) (t t))) (if (boundp 'local-minor-modes) (progn (setq local-minor-modes (delq 'lsp-mode local-minor-modes)) (if lsp-mode (progn (setq local-minor-modes (cons 'lsp-mode local-minor-modes)))))) (if (and lsp-mode (not lsp--buffer-workspaces)) (progn (lsp))) (run-hooks 'lsp-mode-hook (if lsp-mode 'lsp-mode-on-hook 'lsp-mode-off-hook)) (if (called-interactively-p 'any) (progn nil (if (and (current-message) (not (equal last-message (current-message)))) nil (let ((local " in current buffer")) (message "Lsp mode %sabled%s" (if lsp-mode "en" "dis") local))))))
  lsp-mode(toggle)
  funcall-interactively(lsp-mode toggle)
  call-interactively(lsp-mode record nil)
  command-execute(lsp-mode record)
  execute-extended-command(nil "lsp-mode" "lsp-mod")
  funcall-interactively(execute-extended-command nil "lsp-mode" "lsp-mod")
  call-interactively(execute-extended-command nil nil)
  command-execute(execute-extended-command)

Anything else?

I found an older thread that reported a similar issue when opening files over TRAMP (see #2873) although its not clear to me what the solution was there and I'm only opening files from my local filesystem.

yyoncho commented 1 year ago

Are you sure that this reproduces with M-x lsp-start-plain?

ns-rse commented 1 year ago

No, I tried reproducing it with M-x lsp-start-plain and on launching a bunch of packages are installed (under /tmp/lsp-tmp-elpaQ5Wq7v by the looks of it).

On opening a .py file I got the message Unable to find installed server supporting this file. The following servers could be installed automatically:.

Installed M-x package-install pyvenv and activated a virtual environment I know has jedi-language-server installed and got the same error message Unable to find installed server supporting this file. The following servers could be installed automatically:.

Installed M-x package-install lsp-jedi and tried again (with virtual environment still activated) same error message with no list of servers to be installed (not an issue, as I think the server should be used from the virtualenv).

Next I tried M-x lsp-update-servers to see if that made lsp-mode aware of the server available in the activated virtualenv (very similar with M-x lsp-update-server)...

Debugger entered--Lisp error: (cl-assertion-failed ((seq-every-p (apply-partially #'stringp) command) "Invalid command list"))
....

I've gone back to this on your suggestion as I should have done originally and then tried...

M-x package-install use-package and evaluated the following from my settings (although lsp-mode was Unable to calculate the languageId for buffer 'lsp-serrings.el')...

(use-package lsp-jedi
  :ensure t
  :config
  (with-eval-after-load "lsp-mode"
    (add-to-list 'lsp-disabled-clients 'pyls)
    (add-to-list 'lsp-enabled-clients 'jedi)))

Open a .py file and bingo lsp-mode is working.

On that basis I restarted my emacs --fg-daemon process and tried again and everything is back up and running.

Sorry for not doing this all up-front.

I'm curious to understand why this might have broken on upgrading lps-mode and that restarting Emacs solved it. Is it something to do with the byte-compilation perhaps?

yyoncho commented 1 year ago

I'm curious to understand why this might have broken on upgrading lps-mode and that restarting Emacs solved it. Is it something to do with the byte-compilation perhaps?

I thought that you haven't restarted. I changed the code that looks like this:

(defun foo () 
   (lambda (param) ...))

I added one param to the inner lambda and which is called only on startup (when loading the clients). Then the clients will hold a lambda that has less parameters than the expected number.