bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#50816: 28.0.50; [eglot] Nonstandard SymbolKind values for imenu


From: Augusto Stoffel
Subject: bug#50816: 28.0.50; [eglot] Nonstandard SymbolKind values for imenu
Date: Sun, 26 Sep 2021 14:46:26 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

This more about the LSP spec than Eglot, but anyway: I would like to
make the Digestif server provide document outlines via the
`textDocument.documentSymbol' method.  This is not a big deal, and is
implemented internally by the Digestif library already.  Here's the
problem, though: what should I provide as the DocumentSymbol.kind?

The main constituents of a TeX document outline are chapters, sections
and environments.  However, the `kind' attribute of a DocumentSymbol is
not just some name, as one would reasonably expect.  Instead, it's a
number, which the LSP client then looks up in a hardcoded table [🤦].
So in theory one is constrained to the SymbolKinds mentioned in the
spec, none of which is remotely suitable for TeX.

Is there some Eglot-friendly way to get around this silly limitation?

Note that the TeX case may be extreme, but many "normal" programming
languages will have a couple of symbol kinds that don't quite fit that
table.  ELisp has faces, Haskell has typeclasses, and so on.

[🤦]:
https://microsoft.github.io/language-server-protocol/specifications/specification-3-17/#symbolKind





reply via email to

[Prev in Thread] Current Thread [Next in Thread]