Just because a specific request of a specific "hint" is
cancelled doesn't mean we can cancel the other's too. Also
eglot-advertise-cancellation = nil was subtly broken.
This manifested itself mostly in Eglot semantic tokens.
* lisp/progmodes/eglot.el (eglot--async-request): Fix thinkos.
* lisp/progmodes/elisp-mode.el (elisp-byte-code-syntax-propertize):
Reset point to just after the start of the previous match so that we
don't skip past the end of the lazy string, which can happen if it's
zero-length; that could lead to an infinite loop.
This is exclusively for the benefit of rust-analyzer, which
sends publishDiagnostics for all project files upfront, and
never republishes them on 'didOpen'.
See https://github.com/joaotavora/eglot/issues/1531.
* lisp/progmodes/eglot.el (eglot--flymake-handle-push): Simplify.
Don't flymake-list-only-diagnostics here.
Save original diagnostic in flymake-list-only-diagnostics setting.
(eglot--on-shutdown): Cleanup flymake-list-only-diagnostics.
(eglot--flymake-report-push+pulled): Hack in data from
flymake-list-only-diagnostics.
* lisp/progmodes/xref.el (xref--parse-hits, xref--sort-hits):
Extract from xref-matches-in-directory and xref-matches-in-files.
Use in both for better consistency between these functions.
Optionally use find and grep directly instead of going through the
Semantic framework (bug#80246).
* lisp/progmodes/project.el (project--vc-ignores): Require 'vc' to
ensure that vc-default-ignore-completion-table is available.
* lisp/progmodes/xref.el (xref-references-in-directory-function):
New user option.
(xref-references-in-directory): Call it.
(xref-references-in-directory-grep): Implementation based on find/grep.
(xref-references-in-directory-semantic): Implementation using Semantic.
(xref-matches-in-directory): Add new argument DELIMITED.
Co-authored-by: Dmitry Gutov <dmitry@gutov.dev>
* lisp/progmodes/eglot.el (eglot--format-server-message): New helper.
(eglot-handle-notification<window/showMessage>)
(eglot-handle-request<window/showMessageRequest>): Use it.
* lisp/progmodes/python.el (python-ts-mode):
Set 'treesit-sexp-thing-down-list' to 'list' to override
sexp navigation with list navigation (bug#72478).
* lisp/emacs-lisp/lisp.el (up-list): Mention 'up-list-function' in docstring.
* lisp/progmodes/json-ts-mode.el (json-ts--get-path-at-node)
(json-ts--path-to-jq, json-ts--path-to-python): New functions.
(json-ts-jq-path-at-point): New command for getting JSON path at point.
* test/lisp/progmodes/json-ts-mode-tests.el: New file.
Add tests for the utility command.
* etc/NEWS: Announce new command 'json-ts-jq-path-at-point' (bug#80190).
Some language servers request file watching for a very large number of
directories (e.g. Python virtualenvs), which can exhaust system
resources and cause slow startup.
https://github.com/joaotavora/eglot/issues/1568
* lisp/progmodes/eglot.el (eglot-max-file-watches): New variable.
(eglot--count-file-watches): New function.
(eglot--watch-globs): Use them to limit watches. Signal jsonrpc-error
when limit is reached.
(eglot-watch-files-outside-project-root): Fix docstring punctuation.
* etc/EGLOT-NEWS: Mention change.
Now also accepts file operation kinds as keys in the alist form.
* lisp/progmodes/eglot.el (eglot-confirm-server-edits): Rework
default value, docstring and defcustom type.
(eglot--confirm-server-edits): Also check for operation-kind-based
entries.
The current 2026 landscape suggests servers (especially gopls
and ocamllsp) take advantage of this, so let's give it to them
by default.
* lisp/progmodes/eglot.el (eglot-advertise-cancellation):
Default to t.
* etc/EGLOT-NEWS: Mention change.
If the user simply C-g's signal a 'jsonrpc-error' with code 32000 to
mean "no error", provide an LSP :failureReason and keep server chill.
* lisp/progmodes/eglot.el (eglot-handle-request<workspace/applyEdit>>):
Else, if the server asks us a question, the user has just 10
seconds to ponder, which is a bit silly.
* lisp/progmodes/eglot.el (eglot-execute): Pass timeout=nil to
eglot--request.
Previously, the default answer pre-filled in the minibuffer was
obscuring the other possible answers.
* lisp/progmodes/eglot.el
(eglot-handle-request<window/showMessageRequest>): Rework.
It was completely broken, with a cancel being set for every sent (and
probably already received) async request, and no actual discarding
of the response of a cancelled request.
* lisp/progmodes/eglot.el (eglot--async-request): Fix cancellation
of async requests.
(eglot--semtok-request): Don't need 'buf' &aux anymore.
Using 'user-error' in 'hs-minor-mode', prevents the major-mode
from initializing correctly when hideshow is not supported in
that mode, using 'message' instead fixes this.
* lisp/progmodes/hideshow.el (hs-minor-mode): Tweak.
'python-shell-get-process' is frequently called from
'python-eldoc--get-doc-at-point' and etc., invoking
'project-current' unless there is a buffer-specific Inferior
Python process. When the buffer is a remote buffer not
belonging to any project and has significant latency,
'project-current' may take a long time. To avoid this,
implement a process cache in 'python-shell-get-process'.
* lisp/progmodes/python.el (python-shell--process-cache)
(python-shell--process-cache-valid): New variables.
(python-shell--invalidate-process-cache): New function.
(python-shell-make-comint): Add a call to the above function.
(python-shell-get-process): Add process cache. (Bug#80045)
Previously, both the definition of __PYTHON_EL_get_completions
and the call to __PYTHON_EL_get_completions were sent to the
inferior Python each time
'python-shell-completion-get-completions' was executed.
However, there is no need to send the definition every time as
long as the definition remains unchanged. We improved this so
that the definition of __PYTHON_EL_get_completions is only sent
during the inferior Python initialization; it is no longer sent
during 'python-shell-completion-get-completions' execution.
* lisp/progmodes/python.el
(python-shell-completion-send-setup-code): New function.
(python-shell-first-prompt-hook): Add the above new function.
(python-shell-completion-get-completions): Omit sending
'python-shell-completion-setup-code'. (Bug#80182)
* etc/NEWS:
* doc/emacs/maintaining.texi (Projects):
* lisp/progmodes/project.el (project-mode-line): Update
documentation due to changes in bug#78545.
(project-name-cache-timeout): New variable.
(project-name-cached): New function (bug#78545).
(project-mode-line): New value 'non-remote'.
(project-mode-line-format): Don't show the remote project's name
when 'project-mode-line' is 'non-remote'. Use 'project-name-cached'.
* lisp/emacs-lisp/cl-generic.el (cl--generic-make-function):
Preserve advertised-calling-convention info.
* test/lisp/emacs-lisp/pcase-tests.el (pcase-tests-quote-optimization):
Require `byte-opt` to fix the test when the compiler is not loaded yet.
* lisp/progmodes/elisp-mode.el: Fix some >80column problems.
(elisp--xref-format-extra)
(elisp--xref-format): Make them constant, now that we don't have
the purespace. Also, use %S since some of the elements
don't necessarily have names and even if they do, we'd want to
escape any funny characters in them to avoid ambiguities.
(elisp--xref-find-definitions): Fix uses of
`elisp--xref-format-extra` accordingly.
Improve heuristic to distinguish proper `cl-defgeneric` from
implicit ones.
(elisp-eldoc-docstring-length-limit)
(elisp-eldoc-funcall-with-docstring-length): Remove redundant `:group`.
* lisp/cedet/mode-local.el (xref-mode-local-overload): Pass the
override symbol rather than its name through `elisp--xref-format-extra`.
* test/lisp/progmodes/elisp-mode-tests.el (find-defs-constructor):
Adjust test to new text.
* lisp/progmodes/gdb-mi.el (gdb-start-wait-for-pending): New
function.
(gdb-thread-exited): Call 'gdb-start-wait-for-pending' to make
sure the timer which waits for pending GDB commands is launched
just once, even if many =thread-exited notifications are received
at a high rate. Suggested by Neil Roberts <bpeeluk@yahoo.co.uk>.
(Bug#80157)
* lisp/progmodes/eglot.el (eglot--semtok-request)
(eglot--semtok-after-send-changes): Unbreak for 26.3.
* test/lisp/progmodes/eglot-tests.el (eglot--tests-connect): Use
split-string.
(eglot-test-rust-completion-exit-function): Use skip-unless.
Not only is this notification strictly redundant for files
managed by Eglot (since didSave, didClose and didChange are
scrupulously sent), but it also confuses some serers which end
up posting a bunch of useless textDocument/publishDiagnostics,
for example.