summaryrefslogtreecommitdiff
path: root/lisp/progmodes/eglot.el
Commit message (Collapse)AuthorAgeFilesLines
* eglot: Add nushell language servernibon72024-02-021-0/+1
| | | | | * lisp/progmodes/eglot.el (eglot-server-programs): Add nushell language server. (Bug#68823)
* eglot: Add php-ts-mode to eglot-server-programsPiotr Kwiecinski2024-02-021-1/+1
| | | | | | | * lisp/progmodes/eglot.el (eglot-server-programs): Add php-ts-mode. (Bug#68870) Copyright-paperwork-exempt: yes
* Support kotlin-ts-mode in Eglotdalu2024-02-021-1/+1
| | | | | | | * lisp/progmodes/eglot.el (eglot-server-programs): Support kotlin-ts-mode. (Bug#68865) Copyright-paperwork-exempt: yes
* ; Fix typos in symbol namesStefan Kangas2024-01-141-1/+1
|
* ; Add 2024 to copyright yearsPo Lu2024-01-021-1/+1
|
* Eglot: Add Uiua language serverskykanin2023-12-161-1/+2
| | | | | | | * lisp/progmodes/eglot.el (eglot-server-programs): Add Uiua language server. (Bug#67850) Copyright-paperwork-exempt: yes
* Eglot: Add ruff-lsp as an alternative Python serverNiall Dooley2023-12-161-1/+1
| | | | | | | | | | | | | | | | | 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
* * lisp/progmodes/eglot.el (eglot-server-programs): Fix previous commit.João Távora2023-11-151-5/+5
| | | | (cherry picked from commit 58d9e735e721ecf0187a5e15eefc7641112ace0b)
* Eglot: Send standard :language-id for typescript-language-serverJoão Távora2023-11-141-1/+5
| | | | | | | | | bug#67150 * lisp/progmodes/eglot.el (eglot-server-programs): Update language-id for languages handled by typescript-language-server. (cherry picked from commit 1fe949888057b0275da041288709bd5690501974)
* Add "terraform-ls" LSP server to EglotRoss Timson2023-09-011-1/+2
| | | | | | | * lisp/progmodes/eglot.el (eglot-server-programs): Add "terraform-ls", the official Terraform LSP server. (Bug#65671) Copyright-paperwork-exempt: yes
* Add "nixd" LSP server to EglotEli Zaretskii2023-06-221-1/+1
| | | | | * lisp/progmodes/eglot.el (eglot-server-programs): Add "nixd". Patch by Brian Leung <leungbk@posteo.net>. (Bug#64214)
* Eglot: again fix positions of coinciding inlay hint overlays (bug#64101)João Távora2023-06-191-4/+4
| | | | | | | | | | This bug originated from the previous fix, and is reproducible on non Mac OS platforms, as long as the very latest version (at time of writing) of the rust-analyzer server is used. * lisp/progmodes/eglot.el (eglot--update-hints-1): Reverse priorities when pegging overlays after (i.e. when before-string is used).
* Eglot: fix relative position of coinciding inlay hint overlays (bug#64101)João Távora2023-06-171-4/+6
| | | | | | | | Only seems to happen on certain platforms, like Mac OS. Reason unknown reason so far, but this defensive fix seems safe. * lisp/progmodes/eglot.el (eglot--update-hints-1): Explicitly put priority in inlay hint overalys.
* Eglot: re-rename eglot-upgrade to eglot-upgrade-eglotJoão Távora2023-05-051-1/+4
| | | | | | | | | | | * doc/misc/eglot.texi (Getting the latest version): Mention eglot-upgrade-eglot. * etc/EGLOT-NEWS: Mention eglot-upgrade-eglot. * lisp/progmodes/eglot.el (eglot-upgrade-eglot): Rename from eglot-update. (eglot-update): New compatibility alias.
* Rename eglot-update to eglot-upgradeDmitry Gutov2023-05-041-1/+1
| | | | | | | | | * doc/misc/eglot.texi (Getting the latest version): Update the reference. * lisp/progmodes/eglot.el (eglot-upgrade): Rename from 'eglot-update', as discussed on emacs-devel, in line with 'package-upgrade'.
* Eglot: explain how to update Eglot in manual (bug#62720)João Távora2023-04-281-2/+11
| | | | | | * lisp/progmodes/eglot.el (eglot-update): New command. * doc/misc/eglot.texi (Troubleshooting): Rework.
* Eglot: fix edge case when deleting inlay hint overlaysJoão Távora2023-04-281-1/+13
| | | | | | | | | | When asked to update hints in a region (FROM TO), eglot--update-hints-1 first deletes the existing hints. It must however take care to delete all overlays that logically belong to the region, even if they don't physically belong to it, e.g. inlay overlays spanning (FROM-1 FROM) and having a 'after-string' property. * lisp/progmodes/eglot.el (eglot--update-hints-1): Fix edge case.
* ; Support 'dart-ts-mode' in EglotEli Zaretskii2023-04-181-2/+3
| | | | | | * lisp/progmodes/eglot.el (eglot-server-programs): Add 'dart-ts-mode'. Patch by Mou Tong <mou.tong@outlook.com>. (Bug#62879)
* ; Eglot: fix a typo in a customization typeIdir Lankri2023-04-181-1/+1
| | | | | | | * lisp/progmodes/eglot.el (eglot-ignored-server-capabilities): Fix the value associated with the tag "Go to declaration". (Bug#62849) Copyright-paperwork-exempt: yes
* Add to Eglot support for additional language-servers.Jostein Kjønigsen2023-04-151-1/+5
| | | | | | * lisp/progmodes/eglot.el (eglot-server-programs): Add 'vscode-markdown-language-server' for Markdown and 'dot-language-server' for GraphViz. (Bug#62844)
* ; Eglot: make version parseable by version-to-listJoão Távora2023-04-121-1/+1
| | | | * lisp/progmodes/eglot.el (Version): Correct version.
* ; Avoid compiler warning in eglot.el.Eli Zaretskii2023-04-051-0/+1
|
* Eglot: don't watch directories that don't existJoão Távora2023-04-021-2/+3
| | | | | | | | | | | project-files isn't guaranteed to return existing files, so better check if they exist because placing a watcher on them. Originally reported at: https://github.com/joaotavora/eglot/issues/1198 * lisp/progmodes/eglot.el (eglot-register-capability workspace/didChangeWatchedFiles): Check if directories exist.
* Eglot: unbreak eglot-extend-to-xref on w32João Távora2023-03-301-2/+1
| | | | | | | | | | | | | | | | Because of a drive-letter casing mismatch between 'buffer-file-name' and the return value of 'url-generic-parse-url', the hash-table test 'equal' in 'eglot-current-server' failed. This failed to recognize that the file xref landed us on really is managed by the language server that facilitated that jump. The function w32-long-file-name seems to convert "C:/Users/" to "c:/Users" consistently and so is a good addition to eglot--uri-to-path. * lisp/progmodes/eglot.el (eglot--uri-to-path): Use w32-long-file-name.
* Eglot: ensure server shutdown turns off eglot-inlay-hints-modeJoão Távora2023-03-301-0/+1
| | | | | * lisp/progmodes/eglot.el (eglot--managed-mode-off): Turn off eglot-inlay-hints-mode.
* Fix Eglot progress reportingJoão Távora2023-03-231-13/+15
| | | | | | | When the server sends an "end" message, Emacs's progress reporters should also be updated. * lisp/progmodes/eglot.el (eglot-handle-notification $/progress): Rework.
* ; Delete accidental leftover '()' Eglot functionJoão Távora2023-03-211-1/+1
| | | | | * lisp/progmodes/eglot.el (eglot--workspace-configuration-plist): Remove ().
* Eglot: report window/workDoneProgress capability to language serverJoão Távora2023-03-211-0/+1
| | | | | | | | | In bug#59149, LSP progress reporting was implemented, but Eglot's 'capabilities' statement to the server wasn't changed to include window/workDoneProgress. * lisp/progmodes/eglot.el (eglot-client-capabilities): Actually report workDoneProgress.
* Bail early from eglot--apply-text-edits if nothing to doJoão Távora2023-03-191-1/+2
| | | | * lisp/progmodes/eglot.el (eglot--apply-text-edits): Early return.
* ; Clarify in-code commentary of eglot--after-changeJoão Távora2023-03-191-16/+14
| | | | | * lisp/progmodes/eglot.el (eglot--after-change): Minor clarification to commentary.
* Improve ergonomics of Eglot's inlay hintsJoão Távora2023-03-191-14/+23
| | | | | | | | | | | | | | | Instead of deleting inlay hints instantly as soon as the affected changes, make hint overlays span one character (instead of being length 0). Give the overlays an "evaporate" property. Given an inlay hints at position POS, its attached to [POS, POS+1] if it's kind=1 (usually type hints) and [POS-1, POS] otherwise. For kind=1 hints, the 'cursor position of the first such overlay is also tweaked, so that's it's less akward to edit around it. * lisp/progmodes/eglot.el (eglot--before-change): Don't delete hints here. (eglot--update-hints-1): Rework.
* ; Minor fixes in recent Eglot changesEli Zaretskii2023-03-181-1/+1
| | | | | | | * doc/misc/eglot.texi (Project-specific configuration): Fix whitespace. * lisp/progmodes/eglot.el (eglot-diagnostics-map): Doc fix.
* ; Remove overly verbose commentaryJoão Távora2023-03-181-5/+0
| | | | | * lisp/progmodes/eglot.el (eglot--connect): Remove overly verbose commentary.
* Don't take over mouse-1 binding on Eglot diagnostics (bug#62157)João Távora2023-03-181-8/+15
| | | | | | | | | | It's better to give the user a variable to allow the overlay keymap to be customized. * lisp/progmodes/eglot.el (eglot--mouse-call): Accept second arg. (eglot--mode-line-props): Adapt call to eglot--mouse-call (eglot-diagnostics-map): New variable. (eglot-code-actions-at-mouse): New command.
* * lisp/progmodes/eglot.el (eglot--connect): Improve Tramp workaround.Michael Albinus2023-03-181-1/+6
|
* Fix Eglot's snippet insertion to follow the manualJoão Távora2023-03-171-6/+9
| | | | | | | | | | | | | | The manual states that YASnippet must only be installed to be useful. Before this change, it would only work if the user happened to have manually activated it before with 'yas-global-mode' or somesuch. This makes Eglot's Yasnippet-activating behaviour similar to its Flymake-activating behaviour. * lisp/progmodes/eglot.el (eglot-client-capabilities): Consult eglot--stay-out-of. (eglot--snippet-expansion-fn): Turn on yas-minor-mod eon demand. (eglot-completion-at-point): Simplify.
* Also exempt eglot-inlay-hints-mode from desktop.el's fumblingsJoão Távora2023-03-161-6/+4
| | | | | | | Reported in https://github.com/joaotavora/eglot/discussions/1183. * lisp/progmodes/eglot.el (desktop): Also exempt eglot-inlay-hints-mode from desktop.el fumblings.
* Fix Eglot's command generation for code actionsJoão Távora2023-03-161-1/+1
| | | | | | | | | | The user command generated by eglot--code-action should always call eglot-code-actions with a INTERACTIVE set to t. Reported in https://github.com/joaotavora/eglot/issues/1132. * lisp/progmodes/eglot.el (eglot--code-action): Pass INTERACTIVE=t to eglot-code-action call.
* Emphasize emacs-29-specificity in this version of lisp/progmodes/eglot.elJoão Távora2023-03-161-2/+1
| | | | | | | | | | | | | | Do not merge to master. Before working on bugfixes to Eglot in its non-ELPA form delivered with Emacs 29, it's important to distinguish between this emacs-29 version and the one in master, which will also get the bugfixes (via routine gitmerge.el) but with a bumped version number. * lisp/progmodes/eglot.el (Version): Emphasize Emacs 29, but hint this is 1.12 + something. (Package-Requires): Remove. Everything required is already in Emacs 29.
* Bump Eglot version to 1.12João Távora2023-03-131-2/+2
| | | | | | | | * etc/EGLOT-NEWS: New file. * etc/NEWS: Briefly mention etc/EGLOT-NEWS. * lisp/progmodes/eglot.el: Bump versions.
* Amend last Eglot commit (bug#62065)João Távora2023-03-121-2/+1
| | | | | | | The fix contained a spurious check for this-command that shouldn't have made it in.. * lisp/progmodes/eglot.el (eglot-ensure): Don't check this-command.
* Make eglot-ensure's post-command-hook run a bit later (bug#62065)João Távora2023-03-121-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'eglot-ensure', typically used in the major-mode-hook, use 'post-command-hook' to schedule an automated, non-interactive connection attempt to a server. The goal is to connect when the buffer is ready, i.e. after the user command that found the file. However, if there are dir-local or buffer-local variables to confirm, finding the file will cause a minibuffer prompt to appear. In that case, 'eglot-ensure's addition to the global post-command-hook runs before it was intended too and a connection is started prematurely. In turn, this means that a call to 'hack-dir-local-variables' -- which is part of the connection process -- which also needs a minibuffer prompt, collides with the previous one. This generates an error and confuses the user, who doesn't know if the directory-local variables have been applied or not. This commit fixes the clash by having 'eglot-ensure' set 'post-command-hook' buffer-locally. This causes the automated connection to take place, as intended, after the user's original file-finding command has ended. However, the problem reported in bug#62065 is not completely fixed. If the user answers "no" to the first "confirm local variables" "prompt, she will be prompted again in the second one. A subsequent commit will address this separate problem. * lisp/progmodes/eglot.el (eglot-ensure): Use buffer-local post-command-hook.
* Autoload Eglot helper funtion eglot--debbugs-or-github-bug-uriJoão Távora2023-03-091-7/+8
| | | | | | | | | This isn't a typical autoload: the progn block is plced in the autoloads file, but the eglot.el file itself isn't loaded as a result when the function inside the progn block is called. * lisp/progmodes/eglot.el (eglot--debbugs-or-github-bug-uri): autoload, but in progn.
* Turn on Eglot inlay hints by defaultJoão Távora2023-03-041-2/+2
| | | | | | | | | | | | This is like any other server-provided feature, and may be turned off client-side by setting eglot-ignored-server-capabilities like (add-to-list 'eglot-ignored-server-capabilities :inlayHintProvider) * lisp/progmodes/eglot.el (eglot--maybe-activate-editing-mode): Activate eglot-inlay-hints-mode. (eglot-inlay-hints-mode): Instead of warning about missing :inlayHintProvider, turn off eglot-inlay-hints-mode.
* Robustify Eglot for "transient" projectsJoão Távora2023-03-041-1/+2
| | | | | | | | | | | | | | | | | | | | | | | When Eglot needs to synthesize a "transient" project for default-directory sometimes the value of that variable is set to an unexpanded value, sometimes not. This can cause simple invocations like. Emacs -Q ~/path/to-some-python-file.py -f eglot to fail, because eglot--current-server will be looking for a project in the registry called (transient . "~/path") where in reality it is stored there as (transient . "/home/someuser/path") The fix is to always expand default-directory in eglot--current-project. * lisp/progmodes/eglot.el (eglot--current-project): Use expand-file-name.
* Remove Eglot activation check from find-file-hookJoão Távora2023-03-041-1/+0
| | | | | | | | | | | | | Adding eglot--maybe-activate-editing-mode to find-file-hook isn't really necessary, since it is already in 'after-change-major-mode-hook', and that also runs every time we find a file. This reduces the number of project.el logic that runs every time the user visits a file. * lisp/progmodes/eglot.el (find-file-hook): No need to add eglot--maybe-activate-editing-mode here.
* Eglot: pay better attention to hints' paddingLeft/Right (bug#61924)João Távora2023-03-031-0/+2
| | | | | * lisp/progmodes/eglot.el (eglot--update-hints-1): Consider :json-false, which is a non-nil value.
* Eglot: use shell-file-name in eglot--cmd (bug#61748)João Távora2023-03-021-1/+1
| | | | * lisp/progmodes/eglot.el (eglot--cmd): Use shell-file-name.
* ; Eglot: improve bug-reference-url-format/bug-reference-url-regexpJoão Távora2023-03-011-2/+11
| | | | * lisp/progmodes/eglot.el (eglot--debbugs-or-github-bug-uri): New helper.
* Eglot: work around Tramp instability bug#61350João Távora2023-03-011-2/+11
| | | | | | | | | Unconditionally disable ControlMaster for the Eglot's Tramp connection. * lisp/progmodes/eglot.el (tramp-ssh-controlmaster-options) (use-tramp-ssh-controlmaster-options): Forward declare (eglot--connect): Set variables to unconditionally disable ControlMaster.