1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-14 01:50:22 -08:00
Commit graph

1070 commits

Author SHA1 Message Date
dalu
c14c978e3b Support kotlin-ts-mode in Eglot
* lisp/progmodes/eglot.el (eglot-server-programs): Support
kotlin-ts-mode.  (Bug#68865)

Copyright-paperwork-exempt: yes
2024-02-02 08:27:53 +01:00
João Távora
972466dce2 Eglot: fix eglot--dumb-tryc for "only possible completion" case
* lisp/progmodes/eglot.el (eglot--dumb-tryc): Fix for "only possible
  completion" case.
2024-01-26 18:04:51 -06:00
João Távora
b014bca833 Eglot: bump to 1.17
* etc/EGLOT-NEWS: Update.

* lisp/progmodes/eglot.el (Version): Bump to 1.17
(Package-Requires): Bump jsonrpc depedency to 1.24
2024-01-25 12:20:27 +00:00
João Távora
5d88c98e7c Eglot: fix bug introduced when "fixing" middle-of-symbol completions
Culprit:

    commit a6ef458e38
    Author: João Távora <joaotavora@gmail.com>
    Date:   Tue Dec 26 00:31:29 2023 +0000

        Eglot: partial fix for middle-of-symbol completions

The decision to restore the buffer state to when the last LSP
completion set was invoked is rock-solid (because that the state
those completions' edits apply to).

However, when caching the LSP completions across multiple
eglot-completion-at-point calls, we must make sure to also restore the
values of the local values, such as 'bounds-string'.  This allows us
to do that restoration.

* lisp/progmodes/eglot.el (eglot-completion-at-point): Also
restore bounds-string from capf session cache.

Github-reference: https://github.com/joaotavora/eglot/issues/1349
2024-01-25 12:19:17 +00:00
João Távora
65ea742ed5 Eglot: try even harder to avoid other completion styles (bug#68699)
Any completion style except for eglot--dumb-flex spells trouble for
Eglot, for the well known reason that LSP is geared towards completion
tooltips and none of Emacs' partial-completion shenanigans.

This commit puts a "try-completion" function that doesn't return nil
in the eglot--dumb-flex completion style so that other styles aren't
tried (partial-completion, in particular, errors out).

The function often doesn't do anything very useful, but at least it
doesn't stop the more usual *Completions* buffer from appearing.

* lisp/progmodes/eglot.el (eglot--dumb-tryc): New helper.
(completion-styles-alist): Add it to the dumb-flex style.
2024-01-25 01:37:57 +00:00
Basil L. Contovounesios
87cf30fba3 Further shrink eglot--{}
Up to and including Emacs 29, :size 0 was an alias for :size 1.
Emacs 30 gained support for :size 0 hash tables (bug#68244).

* lisp/progmodes/eglot.el (eglot--{}): Define as truly zero-sized.
2024-01-23 10:10:04 +01:00
Eli Zaretskii
8bb5525b62 ; Fix merge snafus
* lisp/jsonrpc.el:
* lisp/progmodes/eglot.el: Fix merge snafus.
2024-01-20 06:37:09 -05:00
Eli Zaretskii
1b31a784bf Merge from origin/emacs-29
5bb5590dec Fix blunder in labeled_narrow_to_region
78ddb32fad Fix documentation of icon-elements
725a3f32f8 ; Fix typos in symbol names
6653ee66ca Improve two docstrings in ox-latex
7d869a0402 Doc fix in auth-source-read-char-choice
f149de223b Merge branch 'emacs-29' of git.savannah.gnu.org:/srv/git/...
1f97a87879 Fix info-xref-tests
51f391998b Add @kindex in manuals for existing keybindings on 'C-x x...
2024-01-20 06:25:59 -05:00
Stefan Kangas
725a3f32f8 ; Fix typos in symbol names 2024-01-14 15:16:54 +01:00
João Távora
b5de9ae801 Eglot: careful when invoking code actions on no symbol at all
Invoking code actions without a marked region or over a symbol
will trip certain servers up since BEG and END in eglot-code-actions
will be nil, causing 'eglot--pos-to-lsp-position' to assume point (which
is OK) but the 'flymake-diagnostics' call to return all diagnostics.

This causes an absolutely undecipherable JavaScript backtrace to be
sent back to Eglot from typescript-language-server.

Github-reference: https://github.com/joaotavora/eglot/issues/847

* lisp/progmodes/eglot.el (eglot--code-action-bounds): Avoid returning
  (list nil nil)
2024-01-06 18:12:14 -06:00
Po Lu
ecf08f0621 Merge from savannah/emacs-29
dc4e6b1329 ; Update copyright years in more files
64b3777631 ; Run set-copyright from admin.el
8e1c56ae46 ; Add 2024 to copyright years

# Conflicts:
#	doc/misc/modus-themes.org
#	doc/misc/texinfo.tex
#	etc/NEWS
#	etc/refcards/ru-refcard.tex
#	etc/themes/modus-operandi-theme.el
#	etc/themes/modus-themes.el
#	etc/themes/modus-vivendi-theme.el
#	lib/alloca.in.h
#	lib/binary-io.h
#	lib/c-ctype.h
#	lib/c-strcasecmp.c
#	lib/c-strncasecmp.c
#	lib/careadlinkat.c
#	lib/cloexec.c
#	lib/close-stream.c
#	lib/diffseq.h
#	lib/dup2.c
#	lib/filemode.h
#	lib/fpending.c
#	lib/fpending.h
#	lib/fsusage.c
#	lib/getgroups.c
#	lib/getloadavg.c
#	lib/gettext.h
#	lib/gettime.c
#	lib/gettimeofday.c
#	lib/group-member.c
#	lib/malloc.c
#	lib/md5-stream.c
#	lib/md5.c
#	lib/md5.h
#	lib/memmem.c
#	lib/memrchr.c
#	lib/nanosleep.c
#	lib/save-cwd.h
#	lib/sha1.c
#	lib/sig2str.c
#	lib/stdlib.in.h
#	lib/strtoimax.c
#	lib/strtol.c
#	lib/strtoll.c
#	lib/time_r.c
#	lib/xalloc-oversized.h
#	lisp/auth-source-pass.el
#	lisp/emacs-lisp/lisp-mnt.el
#	lisp/emacs-lisp/timer.el
#	lisp/info-look.el
#	lisp/jit-lock.el
#	lisp/loadhist.el
#	lisp/mail/rmail.el
#	lisp/net/ntlm.el
#	lisp/net/webjump.el
#	lisp/progmodes/asm-mode.el
#	lisp/progmodes/project.el
#	lisp/progmodes/sh-script.el
#	lisp/textmodes/flyspell.el
#	lisp/textmodes/reftex-toc.el
#	lisp/textmodes/reftex.el
#	lisp/textmodes/tex-mode.el
#	lisp/url/url-gw.el
#	m4/alloca.m4
#	m4/clock_time.m4
#	m4/d-type.m4
#	m4/dirent_h.m4
#	m4/dup2.m4
#	m4/euidaccess.m4
#	m4/fchmodat.m4
#	m4/filemode.m4
#	m4/fsusage.m4
#	m4/getgroups.m4
#	m4/getloadavg.m4
#	m4/getrandom.m4
#	m4/gettime.m4
#	m4/gettimeofday.m4
#	m4/gnulib-common.m4
#	m4/group-member.m4
#	m4/inttypes.m4
#	m4/malloc.m4
#	m4/manywarnings.m4
#	m4/mempcpy.m4
#	m4/memrchr.m4
#	m4/mkostemp.m4
#	m4/mktime.m4
#	m4/nproc.m4
#	m4/nstrftime.m4
#	m4/pathmax.m4
#	m4/pipe2.m4
#	m4/pselect.m4
#	m4/pthread_sigmask.m4
#	m4/readlink.m4
#	m4/realloc.m4
#	m4/sig2str.m4
#	m4/ssize_t.m4
#	m4/stat-time.m4
#	m4/stddef_h.m4
#	m4/stdint.m4
#	m4/stdio_h.m4
#	m4/stdlib_h.m4
#	m4/stpcpy.m4
#	m4/strnlen.m4
#	m4/strtoimax.m4
#	m4/strtoll.m4
#	m4/time_h.m4
#	m4/timegm.m4
#	m4/timer_time.m4
#	m4/timespec.m4
#	m4/unistd_h.m4
#	m4/warnings.m4
#	nt/configure.bat
#	nt/preprep.c
#	test/lisp/register-tests.el
2024-01-02 10:28:14 +08:00
Po Lu
8e1c56ae46 ; Add 2024 to copyright years 2024-01-02 09:47:10 +08:00
João Távora
24741d2563 Eglot: filter by prefix in narrow-scope eglot-code-actions
Github-reference: https://github.com/joaotavora/eglot/issues/847

Servers like typescript-language-server, when asked for {"only" :
"source.organizeImports"}, return actions with the
"source.organizeImports.ts" kind.  Eglot rejected these actions, but
according to the spec:

  Kinds are a hierarchical list of identifiers separated by `.` [...]
  The set of kinds is open.

So I guess we can use string-prefix-p

* lisp/progmodes/eglot.el (eglot-code-actions): Use string-prefix-p.
2024-01-01 15:12:43 -06:00
Stefan Monnier
b0bead793f * lisp/progmodes/eglot.el (toplevel): Fix usual last minute typo 2023-12-29 11:21:38 -05:00
Stefan Monnier
2a8e6c8c84 (require-with-check): New function (bug#67696)
* lisp/files.el (require-with-check): New function.
* lisp/progmodes/eglot.el: Use it (and prefer #' to quote function names).
2023-12-29 11:17:51 -05:00
João Távora
4f017f5f0e Eglot: experimental support for Eglot-only subprojects
* lisp/progmodes/eglot.el
(eglot-alternatives)
(eglot-server-programs): : Rework docstring.
(eglot--guess-contact): Pass project to eglot-server-programs function.
(project-root): Define for new experimental Eglot project type.

Github-reference: https://github.com/joaotavora/eglot/discussions/1337
2023-12-27 09:19:01 -06:00
João Távora
c5a4366b3f Eglot: bump to 1.16
* etc/EGLOT-NEWS: Update.

* lisp/progmodes/eglot.el (Version): Bump to 1.15
(Package-Requires): Bump jsonrpc depedency to 1.23
2023-12-27 08:02:20 -06:00
João Távora
d4485838e1 Eglot: fix typo
* lisp/progmodes/eglot.el (eglot--guess-contact): Fix typo.
2023-12-27 08:02:20 -06:00
João Távora
d9b5f618ba Eglot: introduce eglot-events-buffer-config
* doc/misc/eglot.texi (Eglot Variables): Reword.
(Performance): Reword.

* lisp/progmodes/eglot.el (eglot-events-buffer-size): Obsolete.
(eglot-events-buffer-config): New customization variable.
(eglot--connect): Use eglot-events-buffer-config.
2023-12-27 08:02:20 -06:00
João Távora
d376462c71 Revert "Eglot: Make 'try-completion' less broken"
This reverts commit 4dcbf61c15.

It's not correct, breaks tests.  I declare it impossible to make C-M-i
use of 'try-completion' behave sanely with LSP in its current state.
YMMV.  Use a completion tooltip, like Company.
2023-12-26 10:10:14 -06:00
João Távora
4dcbf61c15 Eglot: Make 'try-completion' less broken
The 'try-completion' completion operation, used mostly in vanilla
'completion-at-point' invoked with C-M-i is close to impossible to get
right in LSP because of the arbitrary edits handled in
':exit-function'.

When this operation is invoked on the table, returning the pattern
argument unchanged somehow (TM) makes a sole completion show the
*Completions* buffer, where selecting it will recover context
necessary for `:exit-function' and call that function.  It doesn't
break any other cases I know, and that's good enough for now.

https://github.com/joaotavora/eglot/issues/1339

* lisp/progmodes/eglot.el (eglot-completion-at-point): Return pattern
when 'try-completion' is invoked.
2023-12-26 07:54:21 -06:00
João Távora
a6ef458e38 Eglot: partial fix for middle-of-symbol completions
* lisp/progmodes/eglot.el (eglot-completion-at-point): Fix
completion reversion in :exit-function.

In a rust-ts-mode buffer such as this main.rs file

  fn main() {
    let v: usize = 1;
    v.c<cursor-here>1234.1234567890
  }

the server wants to edit the line to read, after C-M-i and selecting
"count_ones"

    v.count_ones<cursor-here>.1234567890

But it couldn't apply the edit to the correct initial state because
that state wasn't correctly restored.  This commit fixes that.

However, if the initial state is

    v.count_on1234.1234567890

then completion still fails, because the 'try-completion' call in
eglot-completion-at-point will just return complete to "count_ones"
and Emacs doesn't consider this a completion "exit", so it'll
completely ignore the exit function.

I think 'try-completion' (and 'test-completion') simply can't be used
here (for one, they obey styles, and styles are off-limits in LSP),
but I'll leave that for another commit.

Github-reference: https://github.com/joaotavora/eglot/issues/1339
2023-12-26 02:41:28 +00:00
Eli Zaretskii
1be6204473 Merge from origin/emacs-29
a475165738 * doc/man/emacsclient.1: Fix --tramp option.
1e5357d3d1 * doc/man/emacsclient.1: Add missing sections (bug#66598)
fba7b9db39 Add explanation for extra parentheses in ELisp Introduction
7723282682 Add sample code to the "let*" section in "forward-paragraph"
7a00ca92c1 Fix treesit test (bug#67117)
d220893216 Fix c++-ts-mode indentation (bug#67975)
d386a8aa43 Recommend customizing eglot for python-base-mode
bd0c758971 Improve documentation of new native-compilation commands
1ad126c0f2 ; Fix typo
77678244b8 doc/lispintro: Don't mention `set` (bug#67734)
cb3684e9df Fix script for some characters
2922d683b7 ; * src/treesit.c (treesit_traverse_child_helper): Fix co...
7b315e8a5c Fix an issue when searching subtree backward (bug#67117)
03625c2fef Fix passive mode for tnftp client in ange-ftp.el.
b6429b1c1c ; Improve documentation of ispell.el's dictionary database
75cc159341 ; * etc/PROBLEMS: Update the "GnuPG hangs" entry.
67d9af1c07 Fix using disabled command without a docstring
f68f350023 Improve documentation of text properties handling when ya...
06c399914f Eglot: Add Uiua language server
2023-12-23 06:30:40 -05:00
João Távora
9cb85e950d Eglot: declare eglot-lsp-context bound to non-nil
Otherwise, it'll be really hard to use it in the recommended fashion:

  (defun my/project-find-function (dir)
    (when-let ((match
                (and (bound-and-true-p eglot-lsp-context)
                     (locate-dominating-file dir "some-marker-file"))))
      `(transient . ,match)))

  (add-hook 'project-find-functions #'my/project-find-function)

because 'bound-and-true-p' will never return t even when the hook is called
from eglot--current-project.

Github-reference: https://github.com/joaotavora/eglot/discussions/1336
Github-reference: https://github.com/joaotavora/eglot/discussions/1337

* lisp/progmodes/eglot.el (eglot-lsp-context): Declare normally.
2023-12-22 17:53:23 -06:00
João Távora
e0b9944b69 Jsonrpc: overhaul logging mechanics
* lisp/jsonrpc.el (jsonrpc-connection): Rework.
(initialize-instance :after jsonrpc-connection): New method.
(slot-missing jsonrpc-connection :events-buffer-scrollback-size oset):
New hack.
(jsonrpc-connection-receive): Rework.
(initialize-instance :after jsonrpc-process-connection): Rework
from non-after version.
(jsonrpc-connection-send)
(jsonrpc--call-deferred)
(jsonrpc--process-sentinel)
(jsonrpc--async-request-1, jsonrpc--debug, jsonrpc--log-event)
(jsonrpc--forwarding-buffer): Rework.
(jsonrpc--run-event-hook): New helper.
(jsonrpc-event-hook): New hook.

* lisp/progmodes/eglot.el (eglot-lsp-server): Fix project slot
initform.
(eglot--connect): Use new jsonrpc-connection initarg.

* test/lisp/progmodes/eglot-tests.el (eglot--sniffing): Use
jsonrpc-event-hook.
(eglot-test-basic-completions): Fix test.
2023-12-21 18:29:50 -06:00
João Távora
222f563f13 Jsonrpc: rework implementation of continuations
Preparatory work for fix of bug#67945

* lisp/jsonrpc.el (jsonrpc-connection): Change slots.
(jsonrpc--remove): New helper
(jsonrpc-forget-pending-continuations)
(jsonrpc-connection-receive)
(jsonrpc-request)
(jsonrpc--process-sentinel)
(jsonrpc--async-request-1)
(jsonrpc--async-request-1): Rework.
(jsonrpc-continuation-count): New convenience helper.

* lisp/progmodes/eglot.el (eglot--mode-line-format): Stop using
jsonrpc--request-continuations.
2023-12-20 18:57:18 -06:00
skykanin
06c399914f Eglot: Add Uiua language server
* lisp/progmodes/eglot.el (eglot-server-programs): Add Uiua language
server.  (Bug#67850)

Copyright-paperwork-exempt: yes
2023-12-16 19:35:53 +01:00
Eli Zaretskii
a1d3862c62 Merge from origin/emacs-29
bf4ccb0be0 ; * lisp/term.el (term--xterm-paste): Fix last change.
0d9e2e448d ; * doc/lispref/functions.texi (Function Documentation): ...
791cc5065d Fix shaping of Sinhala text
efcbf0b5ab Add use cases of (fn) documentation facility.
c3331cb365 Fix pasting into terminal-mode on term.el
5be94e2bce Fix opening directory trees from Filesets menu
6b6e770a1f Eglot: Add ruff-lsp as an alternative Python server
ed8a8a5ba1 Fix symbol name in Multisession Variables examples
400ef15bdc js-ts-mode: Fix font-lock rules conflict
c165247c30 Add indentation rules for bracketless statements in js-ts...
7f1bd69cd1 Fix c-ts-mode bracketless indentation for BSD style (bug#...
e23068cb9a Add missing indent rules in c-ts-mode (bug#66152)
d2c4b926ac Fix treesit-default-defun-skipper (bug#66711)
9874561f39 Fix treesit-node-field-name and friends (bug#66674)
eace9e1122 python-ts-mode: Highlight default parameters
23c06c7c30 Update to Org 9.6.13
2023-12-16 09:17:51 -05:00
Niall Dooley
6b6e770a1f Eglot: Add ruff-lsp as an alternative Python server
ruff-lsp [1] is an LSP server for Ruff [2], [3], a fast Python linter
and code formatter.

It supports surfacing Ruff diagnostics and providing Code Actions to
fix them, but is intended to be used alongside another Python LSP in
order to support features like navigation and autocompletion.

[1]: https://github.com/astral-sh/ruff-lsp
[2]: https://github.com/astral-sh/ruff
[3]: https://docs.astral.sh/ruff/

* lisp/progmodes/eglot.el (eglot-server-programs): Add ruff-lsp.

Copyright-paperwork-exempt: yes
2023-12-16 12:10:22 +01:00
João Távora
a4feb79ad4 Eglot: use new jsonrpc-autoport-bootstrap
* lisp/progmodes/eglot.el (eglot-lsp-server): Delete slot
inferior-process.
(eglot--on-shutdown): Simplify.
(eglot--inferior-bootstrap): Delete.
(eglot--connect): Call jsonrpc-autoport-bootstrap.
2023-12-14 23:53:13 +00:00
João Távora
af1fe69f05 Eglot: beware activation in fundamental-mode
In the specific situation of visiting a buffer via M-. with
eglot-extend-to-xref set to t, it was found that buffer was first
visited in fundamental mode, running after-change-major-mode-hook, and
then again in the proper major mode for the file.  The call to
eglot-current-server of the first visit returned non-nil which cause
two didOpen notifications to be issued for the same file.

Furthermore, in the first call, eglot--languageId to returned nil,
prompting an error from servers such as rust-analyzer.

See also: https://github.com/joaotavora/eglot/discussions/1330

* lisp/progmodes/eglot.el (eglot-current-server): Watch out for
fundamental-mode.
2023-12-14 18:08:38 +00:00
João Távora
50bab2a9f7 Eglot: unbreak <host>:<port> spec in C-u M-x eglot (bug#67682)
* lisp/progmodes/eglot.el (eglot--guess-contact): Fix.
2023-12-08 19:13:55 +00:00
João Távora
02d88e36e9 Unbreak Eglot, Jsonrpc as EIEIO inches closer to CLOS (bug#67480)
EIEIO is an innacurate emulation of CLOS in many aspects and one of
them in accessor definition.  Before this commit

commit 6c47931a1a
Author: Brandon <brandon.irizarry@gmail.com>
Date:   Sat Nov 4 17:11:32 2023 -0400

    Make EIEIO ':accessor' behave like ':reader' when reading (bug#66938)

An :initform-less, non-:initarg'ed slot with be read using an
:accessor which would just return nil.  This is EIEIO specific of
course, but it made for (my) sloppy programming in jsonrpc.el and
eglot.el.

Tightening up the rules a bit meant these things broke and now I'm
fixing them.

* lisp/jsonrpc.el (jsonrpc-connection): Add a bunch of :initform nil
(jsonrpc-process-connection): Add a bunch of :initform nil

* lisp/progmodes/eglot.el (eglot-lsp-server): Add a bunch of :initform nil
2023-11-28 18:33:09 -06:00
João Távora
c1251ae1f9 * lisp/progmodes/eglot.el (eglot-server-programs): Fix previous commit.
(cherry picked from commit 58d9e735e7)
2023-11-15 04:18:01 -06:00
João Távora
58d9e735e7 * lisp/progmodes/eglot.el (eglot-server-programs): Fix previous commit. 2023-11-15 04:12:03 -06:00
João Távora
260ba357bb Eglot: Send standard :language-id for typescript-language-server
bug#67150

* lisp/progmodes/eglot.el (eglot-server-programs): Update
language-id for languages handled by typescript-language-server.

(cherry picked from commit 1fe9498880)
2023-11-14 16:26:57 +02:00
João Távora
1fe9498880 Eglot: Send standard :language-id for typescript-language-server
bug#67150

* lisp/progmodes/eglot.el (eglot-server-programs): Update
language-id for languages handled by typescript-language-server.
2023-11-14 00:06:24 +00:00
João Távora
3ab99e977d Eglot: Demote errors to warnings in eglot-ensure
Github-reference: https://github.com/joaotavora/eglot/discussions/1318

* doc/misc/eglot.texi (Quick Start): Reword.
(Starting Eglot): Reword.

* lisp/progmodes/eglot.el (eglot-ensure): Demote errors to warnings.
2023-11-07 09:09:44 -06:00
Mauro Aranda
cb89cbc406 Fix eglot-report-progress :type
* lisp/progmodes/eglot.el (eglot-report-progress): Change :type to
choice, to allow 'messages' as a value.  (Bug#66556)
2023-10-21 12:05:31 +02:00
João Távora
e93d99a4a0 Eglot: respect completion sort order dictated by the server
Don't use flex style to do any completion sorting.

Previously, it was thought that the 'flex' completion style was only
kicking in to do (approximate) fontification of the completions
returned by the server, but it was found that it was also doing some
its own sorting in certain situation of non-empty matching patterns.

Replaced it with a new eglot--dumb-flex style which does only
fontification.

Github-reference: https://github.com/joaotavora/eglot/discussions/1306

* lisp/progmodes/eglot.el (eglot-completion-at-point): Rework.
(eglot--dumb-flex, eglot--dumb-allc): New helpers.
(completion-category-defaults): Rework Eglot-specific category.
(completion-styles-alist): Add Eglot-specific style.

* etc/EGLOT-NEWS: Mention change.
2023-10-18 07:37:57 -05:00
João Távora
76cdf293c4 Eglot: better consider diagnostics at point on code action requests
* lisp/progmodes/eglot.el (eglot--code-action-bounds): Rename from
eglot--code-action-bounds.  Rework to consider diagnostics.
(eglot-code-actions): Use new eglot--code-action-bounds.
(eglot--code-action): Use new eglot--code-action-bounds.

* etc/EGLOT-NEWS: mention change.

GitHub-reference: https://github.com/joaotavora/eglot/discussions/1295
2023-09-20 11:02:51 +01:00
bug-gnu-emacs@gnu.org
b6659e98a4 bug#65673: Add lua-ts-mode
* lisp/progmodes/lua-ts-mode.el:
* test/lisp/progmodes/lua-ts-mode-resources/indent.erts:
* test/lisp/progmodes/lua-ts-mode-tests.el: New files.
* etc/NEWS: Mention the new mode.
* lisp/progmodes/eglot.el (eglot-server-programs):
* lisp/progmodes/hideshow.el (hs-special-modes-alist):
Support 'lua-ts-mode'.
* admin/notes/tree-sitter/build-module/batch.sh:
* admin/notes/tree-sitter/build-module/build.sh: Add Lua.
* test/infra/Dockerfile.emba:
* test/infra/test-jobs.yml: Include lua-ts-mode tests.
2023-09-16 13:01:43 +03:00
Gerd Möllmann
7a3e992ba5 Eglot support for objc-mode
* lisp/progmodes/eglot.el (eglot-server-programs): Add objc-mode to
the list containing c-mode.
2023-09-11 15:02:50 +02:00
João Távora
dc171d5efa Eglot: reorganize Elisp API section, export new functions
bug#65418

Co-authored-by: Filippo Argiolas <filippo.argiolas@gmail.com>

* lisp/progmodes/eglot.el (Obsolete aliases): New section, move
all obsolete aliases here.
(eglot-uri-to-path)
(eglot-path-to-uri)
(eglot-range-region)
(eglot-server-capable)
(eglot-server-capable-or-lose): New functions and backward compability
aliases.
2023-09-04 21:35:41 +01:00
João Távora
6880ea7d22 Eglot: slightly simplify eglot--propose-changes-as-diff
bug#60338

* lisp/progmodes/eglot.el (eglot--propose-changes-as-diff):
Simplify slightly.
2023-09-02 10:51:40 +01:00
Eli Zaretskii
7395123479 Merge from origin/emacs-29
dbbcf4a659 Fix fontification of " in edit-kbd-macro
2137fdfd55 * lisp/emacs-lisp/gv.el (buffer-local-value): Unobsolete ...
e660ee88e3 ; Remove incorrect example from ELisp Reference manual
c32fd92d67 Add documentation to plstore.el
57760f585e * lisp/help.el (substitute-quotes): Improve docstring.
60dcea7658 Fix two defcustom :types
890a4c209a Fix `image-auto-resize-on-window-resize' custom :type
369f2eea10 Add "terraform-ls" LSP server to Eglot
5cbe96d17f ; Improve documentation of 'char-table-range'
a219ee8c31 Fix minor bugs in vc-git and vc-hg on Windows uncovered b...
3f7598806e Add syntax-propertize-function to js-ts-mode
18b292140e ; * src/treesit.c: Add ts function boilerplate
ec4d29c449 Improve performance of treesit_cursor_helper_1

# Conflicts:
#	lisp/vc/vc-git.el
#	src/treesit.c
2023-09-02 04:33:44 -04:00
Eshel Yaron
fdf6c164ef Eglot: rework description and type of eglot-confirm-server-edits
Co-authored-by: João Távora <joaotavora@gmail.com>

* lisp/progmodes/eglot.el (eglot-confirm-server-edits): Improve
type description.
2023-09-01 22:59:48 +01:00
João Távora
82f45b9580 Eglot: handle unsaved buffers in new eglot--propose-changes-as-diff
* lisp/progmodes/eglot.el (eglot--confirm-server-edits): Add docstring.
(eglot--propose-changes-as-diff): Rework.  Handle unsaved buffers.
(eglot--apply-workspace-edit): Rework.
2023-09-01 22:59:48 +01:00
Ross Timson
369f2eea10 Add "terraform-ls" LSP server to Eglot
* lisp/progmodes/eglot.el (eglot-server-programs): Add "terraform-ls",
the official Terraform LSP server.  (Bug#65671)

Copyright-paperwork-exempt: yes
2023-09-01 19:58:26 +02:00
João Távora
ed5ccf9da2 Eglot: revamp confirmation model for server-proposed edits
bug#60338

The variable 'eglot-confirm-server-edits' replaces the obsolete
'eglot-confirm-server-initiated-edits' and brings about a new
confirmation model, making it possible to have only certain commands
require user confirmation.  This was achieved careful usage of the
'this-command' and 'last-command' variables.

There are now two types of confirmation: the usual
minibuffer summary and a temporary 'diff-mode' buffer to display the
proposed changes, so the user can apply them one by one.

Thanks to Philip Kaludercic for the diff-mode idea and implementation.

Co-authored-by: Philip Kaludercic <philipk@posteo.net>

* doc/misc/eglot.texi (Eglot Variables): Describe
'eglot-confirm-server-edits'.

* etc/EGLOT-NEWS (latest): Mention change.

* lisp/progmodes/eglot.el (diff-mode): Require it.
(eglot-confirm-server-initiated-edits): Obsolete it.
(eglot-confirm-server-edits): New variable.
(eglot-handle-request workspace/applyEdit): Use 'last-command'
(eglot-execute t t): Use 'this-command'.
(eglot--apply-workspace-edit): Rework.
(eglot-rename): Use 'this-command'.
2023-09-01 01:00:19 +01:00