abougouffa / minemacs

MinEmacs: an Emacs configuration framework for daily use
https://abougouffa.github.io/minemacs/
MIT License
154 stars 16 forks source link

[Windows] impossible d’utiliser eglot #100

Closed raylemon closed 1 year ago

raylemon commented 1 year ago

Bonjour, il est impossible d’utiliser eglot avec Windows. Voici la backtrace:

Debugger entered--Lisp error: (error "[eglot] -1: Server died")
  error("[eglot] %s" "-1: Server died")
  eglot--error("-1: Server died")
  (if tag (throw tag (cons 'error msg)) (eglot--error msg))
  (let ((msg (format "%s: %s" code message))) (if tag (throw tag (cons 'error msg)) (eglot--error msg)))
  (if canceled nil (jsonrpc-shutdown server) (let ((msg (format "%s: %s" code message))) (if tag (throw tag (cons 'error msg)) (eglot--error msg))))
  (progn (eglot--check-object 'ResponseError object-once (memq 'enforce-required-keys eglot-strict-mode) (memq 'disallow-non-standard-keys eglot-strict-mode) (memq 'check-types eglot-strict-mode)) (if canceled nil (jsonrpc-shutdown server) (let ((msg (format "%s: %s" code message))) (if tag (throw tag (cons 'error msg)) (eglot--error msg)))))
  (let* ((--cl-rest-- object-once) (code (car (cdr (plist-member --cl-rest-- ':code)))) (message (car (cdr (plist-member --cl-rest-- ':message))))) (progn (eglot--check-object 'ResponseError object-once (memq 'enforce-required-keys eglot-strict-mode) (memq 'disallow-non-standard-keys eglot-strict-mode) (memq 'check-types eglot-strict-mode)) (if canceled nil (jsonrpc-shutdown server) (let ((msg (format "%s: %s" code message))) (if tag (throw tag (cons 'error msg)) (eglot--error msg))))))
  (let ((object-once jsonrpc-lambda-elem433)) (let* ((--cl-rest-- object-once) (code (caDebugger entered--Lisp error: (error "[eglot] -1: Server died")Debugger entered--Lisp error: (error "[eglot] -1: Server died")
                                                                                          error("[eglot] %s" "-1: Server died")
                                                                                          eglot--error("-1: Server died")
                                                                                          (if tag (throw tag (cons 'error msg)) (eglot--error msg))
                                                                                          (let ((msg (format "%s: %s" code message))) (if tag (throw tag (cons 'error msg)) (eglot--error msg)))
                                                                                          (if canceled nil (jsonrpc-shutdown server) (let ((msg (format "%s: %s" code message))) (if tag (throw tag (cons 'error msg)) (eglot--error msg))))
                                                                                          (progn (eglot--check-object 'ResponseError object-once (memq 'enforce-required-keys eglot-strict-mode) (memq 'disallow-non-standard-keys eglot-strict-mode) (memq 'check-types eglot-strict-mode)) (if canceled nil (jsonrpc-shutdown server) (let ((msg (format "%s: %s" code message))) (if tag (throw tag (cons 'error msg)) (eglot--error msg)))))
                                                                                          (let* ((--cl-rest-- object-once) (code (car (cdr (plist-member --cl-rest-- ':code)))) (message (car (cdr (plist-member --cl-rest-- ':message))))) (progn (eglot--check-object 'ResponseError object-once (memq 'enforce-required-keys eglot-strict-mode) (memq 'disallow-non-standard-keys eglot-strict-mode) (memq 'check-types eglot-strict-mode)) (if canceled nil (jsonrpc-shutdown server) (let ((msg (format "%s: %s" code message))) (if tag (throw tag (cons 'error msg)) (eglot--error msg))))))
                                                                                          (let ((object-once jsonrpc-lambda-elem433)) (let* ((--cl-rest-- object-once) (code (car (cdr (plist-member --cl-rest-- ':code)))) (message (car (cdr (plist-member --cl-rest-- ':message))))) (progn (eglot--check-object 'ResponseError object-once (memq 'enforce-required-keys eglot-strict-mode) (memq 'disallow-non-standard-keys eglot-strict-mode) (memq 'check-types eglot-strict-mode)) (if canceled nil (jsonrpc-shutdown server) (let ((msg (format "%s: %s" code message))) (if tag (throw tag (cons ... msg)) (eglot--error msg)))))))
                                                                                          (closure ((tag) (canceled) (server . #<eglot-lsp-server eglot-lsp-server-9971615d6c>)) (jsonrpc-lambda-elem433) (let ((object-once jsonrpc-lambda-elem433)) (let* ((--cl-rest-- object-once) (code (car (cdr ...))) (message (car (cdr ...)))) (progn (eglot--check-object 'ResponseError object-once (memq 'enforce-required-keys eglot-strict-mode) (memq 'disallow-non-standard-keys eglot-strict-mode) (memq 'check-types eglot-strict-mode)) (if canceled nil (jsonrpc-shutdown server) (let (...) (if tag ... ...)))))))((:code -1 :message "Server died"))
                                                                                          #f(compiled-function (id triplet) #<bytecode -0x1c33e6ad2f54467a>)(1 ((closure ((tag) (canceled) (server . #<eglot-lsp-server eglot-lsp-server-9971615d6c>) (project transient . "c:/Users/big04/Desktop/") (managed-modes text-mode org-mode markdown-mode rst-mode git-commit-mode)) (jsonrpc-lambda-elem432) (let ((object-once jsonrpc-lambda-elem432)) (let* ((--cl-rest-- object-once) (capabilities (car ...)) (serverInfo (car ...))) (progn (eglot--check-object 'InitializeResult object-once (memq ... eglot-strict-mode) (memq ... eglot-strict-mode) (memq ... eglot-strict-mode)) (if canceled nil (let* ... ...) (let* ... ...) (let* ... ...) (jsonrpc-notify server :initialized eglot--{}) (let ... ...) (let* ... ...) (run-hook-with-args ... server) (eglot--message "Connected! Server `%s' now managing `%s' buffers i..." ... managed-modes ...) (if tag ...)))))) (closure ((tag) (canceled) (server . #<eglot-lsp-server eglot-lsp-server-9971615d6c>)) (jsonrpc-lambda-elem433) (let ((object-once jsonrpc-lambda-elem433)) (let* ((--cl-rest-- object-once) (code (car ...)) (message (car ...))) (progn (eglot--check-object 'ResponseError object-once (memq ... eglot-strict-mode) (memq ... eglot-strict-mode) (memq ... eglot-strict-mode)) (if canceled nil (jsonrpc-shutdown server) (let ... ...)))))) [nil 25771 52555 541600 nil #f(compiled-function () #<bytecode 0x7a22897b98b7898>) nil nil 0 nil]))
                                                                                          maphash(#f(compiled-function (id triplet) #<bytecode -0x1c33e6ad2f54467a>) #<hash-table eql 1/65 0x9971615da9>)
                                                                                          jsonrpc--process-sentinel(#<process EGLOT (Desktop/(text-mode org-mode markdown-mode rst-mode git-commit-mode))<1>"connection broken by remote peer\n")
                                                                                          accept-process-output(nil 0.1)
                                                                                          #f(compiled-function (conn &optional cleanup) "Wait for JSONRPC connection CONN to shutdown.\nWith optional CLEANUP, kill any associated buffers." #<bytecode -0x8b6cd1a14702fae>)(#<eglot-lsp-server eglot-lsp-server-997008d878>)
                                                                                          apply(#f(compiled-function (conn &optional cleanup) "Wait for JSONRPC connection CONN to shutdown.\nWith optional CLEANUP, kill any associated buffers." #<bytecode -0x8b6cd1a14702fae>) #<eglot-lsp-server eglot-lsp-server-997008d878nil)
                                                                                          jsonrpc-shutdown(#<eglot-lsp-server eglot-lsp-server-997008d878>)
                                                                                          (if canceled nil (jsonrpc-shutdown server) (let ((msg (format "Timed out after %s seconds" eglot-connect-timeout))) (if tag (throw tag (cons 'error msg)) (eglot--error msg))))
                                                                                          (closure ((tag) (canceled) (server . #<eglot-lsp-server eglot-lsp-server-997008d878>)) nil (if canceled nil (jsonrpc-shutdown server) (let ((msg (format "Timed out after %s seconds" eglot-connect-timeout))) (if tag (throw tag (cons 'error msg)) (eglot--error msg)))))()
                                                                                          #f(compiled-function () #<bytecode 0x7a22897e48a0eb8>)()
                                                                                          apply(#f(compiled-function () #<bytecode 0x7a22897e48a0eb8>) nil)
                                                                                          timer-event-handler([t 25771 52530 726007 nil #f(compiled-function () #<bytecode 0x7a22897e48a0eb8>) nil nil 0 nil])

                                                                                          error("[eglot] %s" "-1: Server died")
                                                                                          eglot--error("-1: Server died")
                                                                                          (if tag (throw tag (cons 'error msg)) (eglot--error msg))
                                                                                          (let ((msg (format "%s: %s" code message))) (if tag (throw tag (cons 'error msg)) (eglot--error msg)))
                                                                                          (if canceled nil (jsonrpc-shutdown server) (let ((msg (format "%s: %s" code message))) (if tag (throw tag (cons 'error msg)) (eglot--error msg))))
                                                                                          (progn (eglot--check-object 'ResponseError object-once (memq 'enforce-required-keys eglot-strict-mode) (memq 'disallow-non-standard-keys eglot-strict-mode) (memq 'check-types eglot-strict-mode)) (if canceled nil (jsonrpc-shutdown server) (let ((msg (format "%s: %s" code message))) (if tag (throw tag (cons 'error msg)) (eglot--error msg)))))
                                                                                          (let* ((--cl-rest-- object-once) (code (car (cdr (plist-member --cl-rest-- ':code)))) (message (car (cdr (plist-member --cl-rest-- ':message))))) (progn (eglot--check-object 'ResponseError object-once (memq 'enforce-required-keys eglot-strict-mode) (memq 'disallow-non-standard-keys eglot-strict-mode) (memq 'check-types eglot-strict-mode)) (if canceled nil (jsonrpc-shutdown server) (let ((msg (format "%s: %s" code message))) (if tag (throw tag (cons 'error msg)) (eglot--error msg))))))
                                                                                          (let ((object-once jsonrpc-lambda-elem433)) (let* ((--cl-rest-- object-once) (code (car (cdr (plist-member --cl-rest-- ':code)))) (message (car (cdr (plist-member --cl-rest-- ':message))))) (progn (eglot--check-object 'ResponseError object-once (memq 'enforce-required-keys eglot-strict-mode) (memq 'disallow-non-standard-keys eglot-strict-mode) (memq 'check-types eglot-strict-mode)) (if canceled nil (jsonrpc-shutdown server) (let ((msg (format "%s: %s" code message))) (if tag (throw tag (cons ... msg)) (eglot--error msg)))))))
                                                                                          (closure ((tag) (canceled) (server . #<eglot-lsp-server eglot-lsp-server-9971615d6c>)) (jsonrpc-lambda-elem433) (let ((object-once jsonrpc-lambda-elem433)) (let* ((--cl-rest-- object-once) (code (car (cdr ...))) (message (car (cdr ...)))) (progn (eglot--check-object 'ResponseError object-once (memq 'enforce-required-keys eglot-strict-mode) (memq 'disallow-non-standard-keys eglot-strict-mode) (memq 'check-types eglot-strict-mode)) (if canceled nil (jsonrpc-shutdown server) (let (...) (if tag ... ...)))))))((:code -1 :message "Server died"))
                                                                                          #f(compiled-function (id triplet) #<bytecode -0x1c33e6ad2f54467a>)(1 ((closure ((tag) (canceled) (server . #<eglot-lsp-server eglot-lsp-server-9971615d6c>) (project transient . "c:/Users/big04/Desktop/") (managed-modes text-mode org-mode markdown-mode rst-mode git-commit-mode)) (jsonrpc-lambda-elem432) (let ((object-once jsonrpc-lambda-elem432)) (let* ((--cl-rest-- object-once) (capabilities (car ...)) (serverInfo (car ...))) (progn (eglot--check-object 'InitializeResult object-once (memq ... eglot-strict-mode) (memq ... eglot-strict-mode) (memq ... eglot-strict-mode)) (if canceled nil (let* ... ...) (let* ... ...) (let* ... ...) (jsonrpc-notify server :initialized eglot--{}) (let ... ...) (let* ... ...) (run-hook-with-args ... server) (eglot--message "Connected! Server `%s' now managing `%s' buffers i..." ... managed-modes ...) (if tag ...)))))) (closure ((tag) (canceled) (server . #<eglot-lsp-server eglot-lsp-server-9971615d6c>)) (jsonrpc-lambda-elem433) (let ((object-once jsonrpc-lambda-elem433)) (let* ((--cl-rest-- object-once) (code (car ...)) (message (car ...))) (progn (eglot--check-object 'ResponseError object-once (memq ... eglot-strict-mode) (memq ... eglot-strict-mode) (memq ... eglot-strict-mode)) (if canceled nil (jsonrpc-shutdown server) (let ... ...)))))) [nil 25771 52555 541600 nil #f(compiled-function () #<bytecode 0x7a22897b98b7898>) nil nil 0 nil]))
                                                                                          maphash(#f(compiled-function (id triplet) #<bytecode -0x1c33e6ad2f54467a>) #<hash-table eql 1/65 0x9971615da9>)
                                                                                          jsonrpc--process-sentinel(#<process EGLOT (Desktop/(text-mode org-mode markdown-mode rst-mode git-commit-mode))<1>"connection broken by remote peer\n")
                                                                                          accept-process-output(nil 0.1)
                                                                                          #f(compiled-function (conn &optional cleanup) "Wait for JSONRPC connection CONN to shutdown.\nWith optional CLEANUP, kill any associated buffers." #<bytecode -0x8b6cd1a14702fae>)(#<eglot-lsp-server eglot-lsp-server-997008d878>)
                                                                                          apply(#f(compiled-function (conn &optional cleanup) "Wait for JSONRPC connection CONN to shutdown.\nWith optional CLEANUP, kill any associated buffers." #<bytecode -0x8b6cd1a14702fae>) #<eglot-lsp-server eglot-lsp-server-997008d878nil)
                                                                                          jsonrpc-shutdown(#<eglot-lsp-server eglot-lsp-server-997008d878>)
                                                                                          (if canceled nil (jsonrpc-shutdown server) (let ((msg (format "Timed out after %s seconds" eglot-connect-timeout))) (if tag (throw tag (cons 'error msg)) (eglot--error msg))))
                                                                                          (closure ((tag) (canceled) (server . #<eglot-lsp-server eglot-lsp-server-997008d878>)) nil (if canceled nil (jsonrpc-shutdown server) (let ((msg (format "Timed out after %s seconds" eglot-connect-timeout))) (if tag (throw tag (cons 'error msg)) (eglot--error msg)))))()
                                                                                          #f(compiled-function () #<bytecode 0x7a22897e48a0eb8>)()
                                                                                          apply(#f(compiled-function () #<bytecode 0x7a22897e48a0eb8>) nil)
                                                                                          timer-event-handler([t 25771 52530 726007 nil #f(compiled-function () #<bytecode 0x7a22897e48a0eb8>) nil nil 0 nil])
                                                                                      r (cdr (plist-member --cl-rest-- ':code)))) (message (car (cdr (plist-member --cl-rest-- ':message))))) (progn (eglot--check-object 'ResponseError object-once (memq 'enforce-required-keys eglot-strict-mode) (memq 'disallow-non-standard-keys eglot-strict-mode) (memq 'check-types eglot-strict-mode)) (if canceled nil (jsonrpc-shutdown server) (let ((msg (format "%s: %s" code message))) (if tag (throw tag (cons ... msg)) (eglot--error msg)))))))
  (closure ((tag) (canceled) (server . #<eglot-lsp-server eglot-lsp-server-9971615d6c>)) (jsonrpc-lambda-elem433) (let ((object-once jsonrpc-lambda-elem433)) (let* ((--cl-rest-- object-once) (code (car (cdr ...))) (message (car (cdr ...)))) (progn (eglot--check-object 'ResponseError object-once (memq 'enforce-required-keys eglot-strict-mode) (memq 'disallow-non-standard-keys eglot-strict-mode) (memq 'check-types eglot-strict-mode)) (if canceled nil (jsonrpc-shutdown server) (let (...) (if tag ... ...)))))))((:code -1 :message "Server died"))
  #f(compiled-function (id triplet) #<bytecode -0x1c33e6ad2f54467a>)(1 ((closure ((tag) (canceled) (server . #<eglot-lsp-server eglot-lsp-server-9971615d6c>) (project transient . "c:/Users/big04/Desktop/") (managed-modes text-mode org-mode markdown-mode rst-mode git-commit-mode)) (jsonrpc-lambda-elem432) (let ((object-once jsonrpc-lambda-elem432)) (let* ((--cl-rest-- object-once) (capabilities (car ...)) (serverInfo (car ...))) (progn (eglot--check-object 'InitializeResult object-once (memq ... eglot-strict-mode) (memq ... eglot-strict-mode) (memq ... eglot-strict-mode)) (if canceled nil (let* ... ...) (let* ... ...) (let* ... ...) (jsonrpc-notify server :initialized eglot--{}) (let ... ...) (let* ... ...) (run-hook-with-args ... server) (eglot--message "Connected! Server `%s' now managing `%s' buffers i..." ... managed-modes ...) (if tag ...)))))) (closure ((tag) (canceled) (server . #<eglot-lsp-server eglot-lsp-server-9971615d6c>)) (jsonrpc-lambda-elem433) (let ((object-once jsonrpc-lambda-elem433)) (let* ((--cl-rest-- object-once) (code (car ...)) (message (car ...))) (progn (eglot--check-object 'ResponseError object-once (memq ... eglot-strict-mode) (memq ... eglot-strict-mode) (memq ... eglot-strict-mode)) (if canceled nil (jsonrpc-shutdown server) (let ... ...)))))) [nil 25771 52555 541600 nil #f(compiled-function () #<bytecode 0x7a22897b98b7898>) nil nil 0 nil]))
  maphash(#f(compiled-function (id triplet) #<bytecode -0x1c33e6ad2f54467a>) #<hash-table eql 1/65 0x9971615da9>)
  jsonrpc--process-sentinel(#<process EGLOT (Desktop/(text-mode org-mode markdown-mode rst-mode git-commit-mode))<1>"connection broken by remote peer\n")
  accept-process-output(nil 0.1)
  #f(compiled-function (conn &optional cleanup) "Wait for JSONRPC connection CONN to shutdown.\nWith optional CLEANUP, kill any associated buffers." #<bytecode -0x8b6cd1a14702fae>)(#<eglot-lsp-server eglot-lsp-server-997008d878>)
  apply(#f(compiled-function (conn &optional cleanup) "Wait for JSONRPC connection CONN to shutdown.\nWith optional CLEANUP, kill any associated buffers." #<bytecode -0x8b6cd1a14702fae>) #<eglot-lsp-server eglot-lsp-server-997008d878nil)
  jsonrpc-shutdown(#<eglot-lsp-server eglot-lsp-server-997008d878>)
  (if canceled nil (jsonrpc-shutdown server) (let ((msg (format "Timed out after %s seconds" eglot-connect-timeout))) (if tag (throw tag (cons 'error msg)) (eglot--error msg))))
  (closure ((tag) (canceled) (server . #<eglot-lsp-server eglot-lsp-server-997008d878>)) nil (if canceled nil (jsonrpc-shutdown server) (let ((msg (format "Timed out after %s seconds" eglot-connect-timeout))) (if tag (throw tag (cons 'error msg)) (eglot--error msg)))))()
  #f(compiled-function () #<bytecode 0x7a22897e48a0eb8>)()
  apply(#f(compiled-function () #<bytecode 0x7a22897e48a0eb8>) nil)
  timer-event-handler([t 25771 52530 726007 nil #f(compiled-function () #<bytecode 0x7a22897e48a0eb8>) nil nil 0 nil])
abougouffa commented 1 year ago

Cela ne marche pas pour tous les serveurs LSP (genre pyright, clangd, ...) ou seulement ltex-ls?

Je n'ai pas accès à une machine Windows, et je ne l'utilise plus depuis plusieurs années. Je ne peux pas reproduire le problème.

Si vous arrivez à avoir un exemple minimal (emacs -Q) qui ne marche pas, vous pouvez le déclarer directement dans le repo d'Eglot.

raylemon commented 1 year ago

Sur Pyright, ça semble fonctionner. Ce doit être ltex qui pose problème.

abougouffa commented 1 year ago

Avez-vous essayé les deux exemples que j'ai mentionnés dans l'issue précédente (il faudra que me-natural-langs soit active pour que ça fonctionne). Vous pouvez essayer:

(+after-load! '(:and eglot me-eglot-ltex)
  (when-let ((conf (assoc 'org-mode eglot-server-programs (lambda (l e) (memq e l)))))
    (setcdr conf
            (lambda (_)
              (if (or (not (boundp '+ltex-process))
                      (not (process-live-p +ltex-process)))
                  (setq +ltex-process
                        (start-process "eglot/ltex-ls" " *EGLOT ltex-ls process*"
                                       "ltex-ls" "--server-type=TcpSocket" "--port" "9092")))
              '("localhost" 9092)))))

Ou:

(+after-load! '(:and eglot me-eglot-ltex)
  (when-let ((conf (assoc 'org-mode eglot-server-programs (lambda (l e) (memq e l)))))
    (setcdr conf '("ltex-ls"))))

À ajouter dans config.el

raylemon commented 1 year ago

J’ai testé les deux versions, j’ai le même message d’erreur.

abougouffa commented 1 year ago

Essayez :

(+after-load! '(:and eglot me-eglot-ltex)
  (when-let ((conf (assoc 'org-mode eglot-server-programs (lambda (l e) (memq e l)))))
    (setcdr conf
            (lambda (_)
              (if (or (not (boundp '+ltex-process))
                      (not (process-live-p +ltex-process)))
                  (setq +ltex-process
                        (start-process "eglot/ltex-ls" " *EGLOT ltex-ls process*"
                                       "ltex-ls" "--server-type=TcpSocket" "--port" "9092")))
              '("127.0.0.1" 9092)))))
raylemon commented 1 year ago

Toujours pas… j’ai encore le timeout. J’ai récupéré cette trace:

[internal] Tue Jul 11 11:55:30 2023:
(:message "Running language server: 127.0.0.1:9092")
[client-request] (id:1) Tue Jul 11 11:55:30 2023:
(:jsonrpc "2.0" :id 1 :method "initialize" :params
          (:processId nil :clientInfo (:name "Eglot") :rootPath "d:/Latex/"
                      :rootUri "file:///d%3A/Latex" :initializationOptions
                      #s(hash-table size 1 test eql rehash-size 1.5
                                    rehash-threshold 0.8125 data ())
                      :capabilities
                      (:workspace
                       (:applyEdit t :executeCommand
                                   (:dynamicRegistration :json-false)
                                   :workspaceEdit (:documentChanges t)
                                   :didChangeWatchedFiles
                                   (:dynamicRegistration t) :symbol
                                   (:dynamicRegistration :json-false)
                                   :configuration t :workspaceFolders t)
                       :textDocument
                       (:synchronization
                        (:dynamicRegistration :json-false :willSave t
                                              :willSaveWaitUntil t :didSave t)
                        :completion
                        (:dynamicRegistration :json-false :completionItem
                                              (:snippetSupport :json-false
                                                               :deprecatedSupport
                                                               t :resolveSupport
                                                               (:properties
                                                                ["documentation"
                                                                 "details"
                                                                 "additionalTextEdits"])
                                                               :tagSupport
                                                               (:valueSet [1]))
                                              :contextSupport t)
                        :hover
                        (:dynamicRegistration :json-false :contentFormat
                                              ["markdown" "plaintext"])
                        :signatureHelp
                        (:dynamicRegistration :json-false :signatureInformation
                                              (:parameterInformation
                                               (:labelOffsetSupport t)
                                               :documentationFormat
                                               ["markdown" "plaintext"]
                                               :activeParameterSupport t))
                        :references (:dynamicRegistration :json-false)
                        :definition
                        (:dynamicRegistration :json-false :linkSupport t)
                        :declaration
                        (:dynamicRegistration :json-false :linkSupport t)
                        :implementation
                        (:dynamicRegistration :json-false :linkSupport t)
                        :typeDefinition
                        (:dynamicRegistration :json-false :linkSupport t)
                        :documentSymbol
                        (:dynamicRegistration :json-false
                                              :hierarchicalDocumentSymbolSupport
                                              t :symbolKind
                                              (:valueSet
                                               [1 2 3 4 5 6 7 8 9 10 11 12 13 14
                                                  15 16 17 18 19 20 21 22 23 24
                                                  25 26]))
                        :documentHighlight (:dynamicRegistration :json-false)
                        :codeAction
                        (:dynamicRegistration :json-false
                                              :codeActionLiteralSupport
                                              (:codeActionKind
                                               (:valueSet
                                                ["quickfix" "refactor"
                                                 "refactor.extract"
                                                 "refactor.inline"
                                                 "refactor.rewrite" "source"
                                                 "source.organizeImports"]))
                                              :isPreferredSupport t)
                        :formatting (:dynamicRegistration :json-false)
                        :rangeFormatting (:dynamicRegistration :json-false)
                        :rename (:dynamicRegistration :json-false) :inlayHint
                        (:dynamicRegistration :json-false) :publishDiagnostics
                        (:relatedInformation :json-false :codeDescriptionSupport
                                             :json-false :tagSupport
                                             (:valueSet [1 2])))
                       :window (:showDocument (:support t) :workDoneProgress t)
                       :general (:positionEncodings ["utf-32" "utf-8" "utf-16"])
                       :experimental
                       #s(hash-table size 1 test eql rehash-size 1.5
                                     rehash-threshold 0.8125 data ()))
                      :workspaceFolders
                      [(:uri "file:///d%3A/Latex" :name "d:/Latex/")]))
[internal] Tue Jul 11 11:56:00 2023:
(:message "Connection state changed" :change "deleted\n")

----------b---y---e---b---y---e----------
[internal] Tue Jul 11 11:57:23 2023:
(:message "Running language server: 127.0.0.1:9092")
[client-request] (id:1) Tue Jul 11 11:57:23 2023:
(:jsonrpc "2.0" :id 1 :method "initialize" :params
          (:processId nil :clientInfo (:name "Eglot") :rootPath "d:/Latex/"
                      :rootUri "file:///d%3A/Latex" :initializationOptions
                      #s(hash-table size 1 test eql rehash-size 1.5
                                    rehash-threshold 0.8125 data ())
                      :capabilities
                      (:workspace
                       (:applyEdit t :executeCommand
                                   (:dynamicRegistration :json-false)
                                   :workspaceEdit (:documentChanges t)
                                   :didChangeWatchedFiles
                                   (:dynamicRegistration t) :symbol
                                   (:dynamicRegistration :json-false)
                                   :configuration t :workspaceFolders t)
                       :textDocument
                       (:synchronization
                        (:dynamicRegistration :json-false :willSave t
                                              :willSaveWaitUntil t :didSave t)
                        :completion
                        (:dynamicRegistration :json-false :completionItem
                                              (:snippetSupport :json-false
                                                               :deprecatedSupport
                                                               t :resolveSupport
                                                               (:properties
                                                                ["documentation"
                                                                 "details"
                                                                 "additionalTextEdits"])
                                                               :tagSupport
                                                               (:valueSet [1]))
                                              :contextSupport t)
                        :hover
                        (:dynamicRegistration :json-false :contentFormat
                                              ["markdown" "plaintext"])
                        :signatureHelp
                        (:dynamicRegistration :json-false :signatureInformation
                                              (:parameterInformation
                                               (:labelOffsetSupport t)
                                               :documentationFormat
                                               ["markdown" "plaintext"]
                                               :activeParameterSupport t))
                        :references (:dynamicRegistration :json-false)
                        :definition
                        (:dynamicRegistration :json-false :linkSupport t)
                        :declaration
                        (:dynamicRegistration :json-false :linkSupport t)
                        :implementation
                        (:dynamicRegistration :json-false :linkSupport t)
                        :typeDefinition
                        (:dynamicRegistration :json-false :linkSupport t)
                        :documentSymbol
                        (:dynamicRegistration :json-false
                                              :hierarchicalDocumentSymbolSupport
                                              t :symbolKind
                                              (:valueSet
                                               [1 2 3 4 5 6 7 8 9 10 11 12 13 14
                                                  15 16 17 18 19 20 21 22 23 24
                                                  25 26]))
                        :documentHighlight (:dynamicRegistration :json-false)
                        :codeAction
                        (:dynamicRegistration :json-false
                                              :codeActionLiteralSupport
                                              (:codeActionKind
                                               (:valueSet
                                                ["quickfix" "refactor"
                                                 "refactor.extract"
                                                 "refactor.inline"
                                                 "refactor.rewrite" "source"
                                                 "source.organizeImports"]))
                                              :isPreferredSupport t)
                        :formatting (:dynamicRegistration :json-false)
                        :rangeFormatting (:dynamicRegistration :json-false)
                        :rename (:dynamicRegistration :json-false) :inlayHint
                        (:dynamicRegistration :json-false) :publishDiagnostics
                        (:relatedInformation :json-false :codeDescriptionSupport
                                             :json-false :tagSupport
                                             (:valueSet [1 2])))
                       :window (:showDocument (:support t) :workDoneProgress t)
                       :general (:positionEncodings ["utf-32" "utf-8" "utf-16"])
                       :experimental
                       #s(hash-table size 1 test eql rehash-size 1.5
                                     rehash-threshold 0.8125 data ()))
                      :workspaceFolders
                      [(:uri "file:///d%3A/Latex" :name "d:/Latex/")]))
[internal] Tue Jul 11 11:57:53 2023:
(:message "Connection state changed" :change "deleted\n")

----------b---y---e---b---y---e----------

Je confirme aussi que eglot avec pyright fonctionne sans soucis. J’ai installé ltex-ls 16, et je l’ai lancé en serveur avant. Sans succès…

abougouffa commented 1 year ago

Oui, c'est bizarre comme comportement, sans machine Windows, je ne peux pas t'aider plus que ça.

Essaye de:

raylemon commented 1 year ago

On dirait que eglot ne gère pas correctement les liens…

let: Searching for program: No such file or directory, localhost:42421
cond: No link found
abougouffa commented 1 year ago

Ah, essaye de le changer à 127.0.0.1:

(+eglot-register
  '(text-mode org-mode markdown-mode rst-mode git-commit-mode)
  '("127.0.0.1" 42421)))
raylemon commented 1 year ago

Même problème…

abougouffa commented 1 year ago

End supposant que le chemin de ltex-ls est dans la PATH de l'environnement, essaie:

(+eglot-register
  '(text-mode org-mode markdown-mode rst-mode git-commit-mode)
  "ltex-ls"))

Sinon, tu peut remplacer "ltex-ls" par le chemin complet de la commande (genre "C:\\ltex\\bin\\ltex-ls.bat")

raylemon commented 1 year ago

Je pense que le problème n’est pas eglot, mais ltex… Il me semble voir que le serveur tente de démarrer (du moins avec ton code ci-dessus, je vais tester sans juste après).

Les messages d’erreur obtenus sont des messages d’erreur Java avec une classe qui ne se charge pas.

raylemon commented 1 year ago

Ok ,enfin ça fonctionne! Le problème était double. Il y a bien un souci sur la version de LTeX (16.0.0.0). En rétrogradant de version, ça fonctionne. J’ai testé toutes les solutions que tu m’as indiquée dans l’ordre, et seule la solution envoyée ce 12 juillet permet de faire fonctionner eglot.

Sous linux, je n’ai pas eu le moindre soucis.

Merci énormément de ton aide, et je reste à ta disposition pour faire des tests sous Windows ;)

abougouffa commented 1 year ago

Super! Merci à toi pour ta patience! Je te solliciterai sans doute si j'ai un problème sous Windows :D