unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Michael Eliachevitch <m.eliachevitch@posteo.de>
To: 62907@debbugs.gnu.org
Subject: bug#62907: Eglot does not start managing LaTeX buffer despite reporting successful connection
Date: Mon, 17 Apr 2023 15:21:12 +0000	[thread overview]
Message-ID: <87354y1ofp.fsf@posteo.de> (raw)

[-- Attachment #1: Type: text/plain, Size: 7563 bytes --]

User-agent: mu4e 1.11.2; emacs 30.0.50

When I run `M-x eglot' in a LaTeX-buffer and select "texlab" as a language-server, I get an echo-area message indicating that the connection was successful:

  [eglot] Connected! Server `TexLab' now managing `(tex-mode context-mode texinfo-mode bibtex-mode)' buffers in project `phd-thesis'.

However, I don't get any mode-line indication and the variable `eglot--managed-mode' is nil, so it seems it didn't properly activate.

I initally noticed the error in that when I tried auto-completing with `eglot-completion-at-point', I got the error message

  (jsonrpc-error "No current JSON-RPC connection" (jsonrpc-error-code . 32603) (jsonrpc-error-message . "No current JSON-RPC connection"))

I get the same message when e.g. running `M-x eglot-stderr-buffer', so I cannot attach that, but I attached the contents of eglot-events-buffer. With debug-on-error enabled I get the backtrace

  Debugger entered--Lisp error: (jsonrpc-error "No current JSON-RPC connection" (jsonrpc-error-code . 32603) (jsonrpc-error-message . "No current JSON-RPC connection"))
    jsonrpc-error("No current JSON-RPC connection")
    eglot--current-server-or-lose()
    byte-code("\300 C\207" [eglot--current-server-or-lose] 1)
    command-execute(eglot-stderr-buffer record)
    execute-extended-command(nil "eglot-stderr-buffer" nil)
    funcall-interactively(execute-extended-command nil "eglot-stderr-buffer" nil)
    command-execute(execute-extended-command)

But the initial bug is that Eglot didn't start managing the buffer when I run the command and that doesn't raise an error initially.

I can reproduce the error with "emacs -Q". It seemed to work in the past (couple of weeks ago) and now it doesn't anymore. I changed a lot in my Emacs config but that it works with emacs -Q suggests something else changed rather than just my emacs init file.

I tried two texlab versions, 5.4.1 and 5.5.0 and also other latex language-servers such as digestif and ltex-ls and got the same issue. Also it doesn't matter whether I use AucTeX or plain latex.el (which I had in emacs -Q anyway). I also disabled my dir-local variables when testing. So it doesn't seem to depend on the latex language server version.

However, I don't have problems running Eglot in other major modes, e.g. it works in Python with the pylsp  server.

For reproducing, any latex file seemed to work for me, but I attached a very minimal latex-project for testing anyway. texlab can be downloaded as a static binary from https://github.com/latex-lsp/texlab/releases/tag/v5.5.0. Then, to reproduce, just open the latex file in the attached project, run `M-x eglot', select texlab, and check if it starts managing the buffer. Then, `eglot--managed-mode' should be `t' and I expect auto-completion to work.

I'm still not 100% sure this is a bug or something messed up in my local configuration, but I just couldn't find the issue, so I thought I might as well report it just in case it's not known. If you cannot reproduce it with the above instructions, feel free to close this bug. Below is the additional system and config information as provided by report-emacs-bug.

Cheers, Michael

---

In GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
 3.24.37, cairo version 1.17.8) of 2023-04-17 built on e490
Repository revision: a46201f57eb114b8107435caf3588edbb666829e
Repository branch: master
System Description: Arch Linux

Configured using:
 'configure --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib
 --localstatedir=/var --mandir=/usr/share/man --with-gameuser=:games
 --with-modules --without-libotf --without-m17n-flt --without-gconf
 --enable-link-time-optimization --with-native-compilation=yes
 --with-xinput2 --with-pgtk --without-xaw3d --with-sound=alsa
 --with-xwidgets --with-tree-sitter --without-gpm
 --without-compress-install
 '--program-transform-name=s/\([ec]tags\)/\1.emacs/'
 'CFLAGS=-march=native -mtune=generic -O3 -pipe -fno-plt -fexceptions
 -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security
 -fstack-clash-protection -fcf-protection -fuse-ld=mold -fuse-ld=mold'
 LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG JSON
LCMS2 LIBSYSTEMD LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PGTK
PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS
TREE_SITTER WEBP XIM XWIDGETS GTK3 ZLIB

Important settings:
  value of $LC_ALL: C.UTF-8
  value of $LC_COLLATE: C.UTF-8
  value of $LC_CTYPE: en_GB.UTF-8
  value of $LC_MESSAGES: en_US.UTF-8
  value of $LC_MONETARY: de_DE.UTF-8
  value of $LC_NUMERIC: en_US.UTF-8
  value of $LC_TIME: de_DE.UTF-8
  value of $LANG: C
  value of $XMODIFIERS: @im=fcitx
  locale-coding-system: utf-8-unix

Major mode: LaTeX

Minor modes in effect:
  shell-dirtrack-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  line-number-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message mailcap yank-media puny dired
dired-loaddefs rfc822 mml mml-sec epa derived epg rfc6068 epg-config
gnus-util mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev
gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util
mail-prsvr mail-utils tutorial thai-util thai-word mule-util lao-util
enriched disp-table facemenu view face-remap time-date cus-edit
cus-start cus-load wid-edit eglot external-completion jsonrpc xref
flymake-proc flymake thingatpt project ert pp ewoc debug backtrace
find-func filenotify pcase url-util url-parse auth-source eieio
eieio-core password-cache json map byte-opt url-vars imenu comp
comp-cstr warnings icons rx cl-seq cl-macs gv cl-extra help-mode
bytecomp byte-compile vc-git diff-mode easy-mmode vc-dispatcher
cl-loaddefs cl-lib tex-mode compile text-property-search shell subr-x
pcomplete comint ansi-osc ansi-color ring latexenc rmc iso-transl
tooltip cconv eldoc paren electric uniquify ediff-hook vc-hooks
lisp-float-type elisp-mode mwheel term/pgtk-win pgtk-win term/common-win
pgtk-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list
replace newcomment text-mode lisp-mode prog-mode register page tab-bar
menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse
jit-lock font-lock syntax font-core term/tty-colors frame minibuffer
nadvice seq simple cl-generic indonesian philippine cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european
ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop
case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure
cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp
files window text-properties overlay sha1 md5 base64 format env
code-pages mule custom widget keymap hashtable-print-readable backquote
threads xwidget-internal dbusbind inotify dynamic-setting
system-font-setting font-render-setting cairo gtk pgtk lcms2 multi-tty
make-network-process native-compile emacs)

Memory information:
((conses 16 299038 29240)
 (symbols 48 14103 0)
 (strings 32 63171 2952)
 (string-bytes 1 1850467)
 (vectors 16 37399)
 (vector-slots 8 678882 29431)
 (floats 8 97 380)
 (intervals 56 856 0)
 (buffers 984 19))



[-- Attachment #2: eglot-events-buffer.eld --]
[-- Type: text/plain, Size: 7341 bytes --]

[internal] Mon Apr 17 17:36:18 2023:
(:message "Running language server: /usr/sbin/texlab")
[client-request] (id:1) Mon Apr 17 17:36:18 2023:
(:jsonrpc "2.0" :id 1 :method "initialize" :params
          (:processId 175044 :clientInfo
                      (:name "Eglot")
                      :rootPath "/home/michael/projects/phd-thesis/" :rootUri "file:///home/michael/projects/phd-thesis" :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 t :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
                       (: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:///home/michael/projects/phd-thesis" :name "~/projects/phd-thesis/")]))
[server-reply] (id:1) Mon Apr 17 17:36:18 2023:
(:jsonrpc "2.0" :id 1 :result
          (:capabilities
           (:completionProvider
            (:resolveProvider t :triggerCharacters
                              ["\\" "{" "}" "@" "/" " "])
            :definitionProvider t :documentFormattingProvider t :documentHighlightProvider t :documentLinkProvider
            (:resolveProvider :json-false)
            :documentSymbolProvider t :executeCommandProvider
            (:commands
             ["texlab.cleanAuxiliary" "texlab.cleanArtifacts" "texlab.changeEnvironment"])
            :foldingRangeProvider t :hoverProvider t :inlayHintProvider t :referencesProvider t :renameProvider
            (:prepareProvider t)
            :textDocumentSync
            (:change 2 :openClose t :save
                     (:includeText :json-false))
            :workspaceSymbolProvider t)
           :serverInfo
           (:name "TexLab" :version "5.5.0")))
[client-notification] Mon Apr 17 17:36:18 2023:
(:jsonrpc "2.0" :method "initialized" :params #s(hash-table size 1 test eql rehash-size 1.5 rehash-threshold 0.8125 data
                                                            ()))
[client-notification] Mon Apr 17 17:36:18 2023:
(:jsonrpc "2.0" :method "workspace/didChangeConfiguration" :params
          (:settings #s(hash-table size 1 test eql rehash-size 1.5 rehash-threshold 0.8125 data
                                   ())))
[server-request] (id:1) Mon Apr 17 17:36:18 2023:
(:jsonrpc "2.0" :id 1 :method "workspace/configuration" :params
          (:items
           [(:section "texlab")]))
[client-reply] (id:1) Mon Apr 17 17:36:18 2023:
(:jsonrpc "2.0" :id 1 :result
          [nil])
[server-request] (id:2) Mon Apr 17 17:36:18 2023:
(:jsonrpc "2.0" :id 2 :method "workspace/configuration" :params
          (:items
           [(:section "texlab")]))
[client-reply] (id:2) Mon Apr 17 17:36:18 2023:
(:jsonrpc "2.0" :id 2 :result
          [nil])

[-- Attachment #3: latex-mwe.tar.gz --]
[-- Type: application/gzip, Size: 10840 bytes --]

             reply	other threads:[~2023-04-17 15:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-17 15:21 Michael Eliachevitch [this message]
     [not found] ` <handler.62907.B.168174773410232.ack@debbugs.gnu.org>
2023-04-17 18:16   ` bug#62907: Eglot does not start managing LaTeX buffer despite reporting successful connection Michael Eliachevitch
2023-04-17 18:31     ` João Távora
2023-04-17 20:29       ` Michael Eliachevitch
2023-04-19  0:10         ` João Távora

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87354y1ofp.fsf@posteo.de \
    --to=m.eliachevitch@posteo.de \
    --cc=62907@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).