1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-08 15:35:02 +00:00
emacs/test/lisp
João Távora a74403adda Eglot: fix LSP "languageId" detection
This sweeping fix has been planned for a while, but a user recently
hit this bug as described in
https://github.com/joaotavora/eglot/discussions/1206.

More and more servers today are "multi-language", meaning can handle
more than one file type.  This relies on the ':languageId' string
being set to the correct value for every buffer managed by Eglot
(TextDocumentItem in LSP parlance).

Previously this string was calculated based on an imperfect heuristic
and was wrong quite often.  Many servers don't even care but some
others do, so we have to fix it.

* lisp/progmodes/eglot.el (eglot-lsp-server): Remove slots
'major-modes' and 'language-id'.  Add slot 'languages'.
(eglot--major-modes, eglot--language-ids): New helpers.
(eglot--lookup-mode): Simplify or maybe complicate.
(eglot--guess-contact): Use new eglot--looup-mode.  Change return
value.
(eglot): Rework docstring.
(eglot-reconnect): Use eglot--language-ids, not id.
(eglot--connect): Setup eglot--languages slot in server.
(eglot--TextDocumentItem): Finally, get correct language id.

* test/lisp/progmodes/eglot-tests.el (eglot--guessing-contact):
Enhance macro.
(eglot-test-server-programs-guess-lang): Update test.
2023-04-13 17:42:37 +01:00
..
align-resources
auth-source-resources Move netrc tests to auth-source-tests.el 2022-08-04 17:33:34 +02:00
bookmark-resources
calc ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
calendar ; Adjust limit for eclipse in calendar; rename a function 2023-02-17 22:34:05 +01:00
cedet ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
custom-resources
dired-resources/insert-directory
emacs-lisp Pacify byte-compiler warnings in nadvice-tests 2023-04-09 19:03:10 +01:00
emulation ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
epg-resources Replace aging OpenPGP artifacts in the epg tests. 2022-10-06 14:53:39 +02:00
erc Allow erc-reuse-frames to favor connections 2023-04-08 14:23:51 -07:00
eshell Fix using background commands in 'eshell-command' 2023-04-02 15:05:53 -07:00
faces-resources ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
files-resources
gnus Remove useless unwind-protect forms, or make them useful as intended 2023-04-07 19:08:33 +02:00
hfy-cmap-resources
image ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
international Fix mule-tests in UTF-8 locales 2023-02-26 11:46:20 +02:00
loadhist-resources ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
mail ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
mh-e ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
minibuffer-resources
net Adapt Tramp test 2023-04-09 18:51:21 +02:00
nxml ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
obsolete ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
org ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
pcmpl-linux-resources
play ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
progmodes Eglot: fix LSP "languageId" detection 2023-04-13 17:42:37 +01:00
saveplace-resources
so-long-tests ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
term ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
textmodes Make 'emacs-news-cycle-tag' work at all levels 2023-02-21 15:25:36 +01:00
time-resources
url Use more recent public_suffix_list.dat where possible 2023-02-17 22:50:13 +01:00
use-package ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
vc ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
xdg-resources
abbrev-tests.el ; * test/lisp/abbrev-tests.el (abbrev--possibly-save-test): Fix test. 2023-03-18 12:35:10 +02:00
align-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
allout-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
allout-widgets-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
ansi-color-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
ansi-osc-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
apropos-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
arc-mode-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
auth-source-pass-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
auth-source-tests.el Fix some `unwind-protect' forms 2023-04-03 13:18:55 +02:00
autoinsert-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
autorevert-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
battery-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
bookmark-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
buff-menu-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
button-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
calculator-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
char-fold-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
color-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
comint-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
completion-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
cus-edit-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
custom-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
dabbrev-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
delim-col-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
descr-text-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
desktop-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
dired-aux-tests.el ; * test/lisp/dired-aux-tests.el: remove mistaken unwind-protect 2023-03-29 22:18:28 +02:00
dired-tests.el Remove useless unwind-protect forms, or make them useful as intended 2023-04-07 19:08:33 +02:00
dired-x-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
dnd-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
dom-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
edmacro-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
electric-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
elide-head-tests.el Merge from origin/emacs-29 2023-01-01 05:47:47 -05:00
env-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
epg-config-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
epg-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
faces-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
ffap-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
filenotify-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
files-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
files-x-tests.el Fix connection-local variables settings 2023-03-13 18:02:36 +01:00
find-cmd-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
font-lock-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
format-spec-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
help-fns-tests.el Detect and prevent function alias loops in fset and defalias 2023-02-21 10:42:00 +01:00
help-mode-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
help-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
hfy-cmap-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
hi-lock-tests.el Fix hi-lock-tests when 'use-dialog-box' is non-nil 2023-02-18 10:45:12 +02:00
hl-line-tests.el Remove useless unwind-protect forms, or make them useful as intended 2023-04-07 19:08:33 +02:00
htmlfontify-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
ibuffer-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
ido-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
image-file-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
image-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
imenu-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
info-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
info-xref-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
isearch-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
jit-lock-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
json-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
jsonrpc-tests.el Better jsonrpc.el workaround for debug-on-error check 2023-03-14 19:36:47 +00:00
kmacro-tests.el Fix insertion of keyboard macro containing named keys 2023-02-24 11:43:08 +01:00
loadhist-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
lpr-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
ls-lisp-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
man-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
md4-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
minibuffer-tests.el Fix the case in first-completion revealed by minibuffer-tests 2023-01-14 20:56:33 +02:00
misc-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
mouse-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
mwheel-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
newcomment-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
obarray-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
paren-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
password-cache-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
pcmpl-linux-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
pcomplete-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
proced-tests.el Preserve the window position with proced (bug#60381) 2023-01-14 10:36:15 +02:00
ps-print-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
register-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
repeat-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
replace-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
rot13-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
saveplace-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
scroll-lock-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
server-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
ses-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
shadowfile-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
shell-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
simple-tests.el Stronger checking in line-number-at-pos tests 2023-04-13 17:35:45 +02:00
sort-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
soundex-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
startup-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
subr-tests.el Remove useless unwind-protect forms, or make them useful as intended 2023-04-07 19:08:33 +02:00
tab-bar-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
tabify-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
tar-mode-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
tempo-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
term-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
thingatpt-tests.el Improve thing-at-point email detection 2023-03-10 11:22:54 +01:00
thread-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
time-stamp-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
time-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
timezone-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
version-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
wdired-tests.el Fix wdired-tests on MS-Windows 2023-03-02 14:21:33 +02:00
whitespace-tests.el Merge from origin/emacs-29 2023-01-01 05:47:47 -05:00
wid-edit-tests.el Fix `pr-interface' 2023-01-06 10:06:25 +01:00
x-dnd-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
xdg-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
xml-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
xt-mouse-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
yank-media-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00