EGLOT-NEWS (22616B)
1 Eglot NEWS -*- outline -*- 2 3 Copyright (C) 2018-2024 Free Software Foundation, Inc. 4 See the end of the file for license conditions. 5 6 Please send Eglot bug reports to 'bug-gnu-emacs@gnu.org', and Cc (or 7 X-Debbugs-CC) the maintainer 'joaotavora@gmail.com' as well. Please 8 read the chapter titled "Troubleshooting" in the Eglot manual, 9 available https://joaotavora.github.io/eglot/#Troubleshooting-Eglot 10 11 This file is about changes in Eglot, the Emacs client for LSP 12 (Language Server Protocol) distributed with GNU Emacs since Emacs 13 version 29.1 and with GNU ELPA since 2018. 14 15 Note: references to some Eglot issues are presented as "github#nnnn". 16 This refers to https://github.com/joaotavora/eglot/issues/. That is, 17 to look up issue github#1234, go to 18 https://github.com/joaotavora/eglot/issues/1234. 19 20 21 * Changes in upcoming Eglot 22 23 24 * Changes in Eglot 1.17 (25/1/2024) 25 26 ** Fixes to completion (github#847, github#1349) 27 28 ** Fix code-action gathering for some servers (github#847) 29 30 ** Experimental support for Eglot-only subprojects 31 32 Until project.el's support for subprojects improves, github#1337 33 describes a reasonably sane way to configure nested sub-projects 34 within a larger one just for Eglot purposes. 35 36 37 * Changes in Eglot 1.16 (27/12/2023) 38 39 ** Code actions can be previewed in diff format 40 41 The variable 'eglot-confirm-server-edits' replaces the obsolete 42 'eglot-confirm-server-initiated-edits' and brings about a new 43 confirmation model for code actions, making it possible to have only 44 certain commands require user confirmation. It allows a temporary 45 'diff-mode' buffer to display the proposed changes, so the user can 46 apply them one by one. See bug#60338. 47 48 ** Completion sorting has been fixed 49 50 In some situations, Eglot was not respecting the completion sort order 51 decided by the language server, falling back on the sort order 52 determined by the 'flex' completion style instead. See github#1306. 53 54 ** Improve mouse invocation of code actions 55 56 When invoking code actions by middle clicking with the mouse on 57 Flymake diagnostics, it was often the case that Eglot didn't request 58 code actions correctly and thus no actions were offered to the user. 59 This has been fixed. See github#1295. 60 61 ** Optimized file-watching capability 62 63 Some servers, like the Pyright language server, issue too many file 64 watching requests. This change slightly reduces the number of file 65 watcher objects requested from the operating system, which can be a 66 problem, particularly on Mac OS. See github#1228 and github#1226. 67 68 ** Faster, more accurate, event logging 69 70 The Eglot events buffer takes advantage of new functionality in 71 Jsonrpc 1.23. By default, Lisp-style printing of JSON-RPC message (a 72 common cause of performance degradation) is disabled. The full 73 original JSON message is presented instead. See new variable 74 'eglot-events-buffer-config', which replaces the obsolete 75 'eglot-events-buffer-size'. 76 77 ** 'textdocument/onTypeFormatting' feature has been fixed 78 79 For 'newline' commands, Eglot sometimes sent the wrong character code 80 to the server. Also this feature is now less chatty in the mode-line 81 and messages buffer. 82 83 ** Partial fix C-M-i "middle-of-symbol" completions (github#1339) 84 85 ** Add "Extending Eglot" section to manual 86 87 ** Fixed Elisp interface 'eglot-lsp-context' (github#1336, github#1337) 88 89 ** Supports LSP's 'window/showRequest' (bug#62116) 90 91 ** The self-upgrade command is now called 'eglot-upgrade-eglot' 92 93 ** Newly added directories also watched (github#1228) 94 95 ** Send correct ':language-id' for JavaScript server (bug#67150) 96 97 ** New servers have been added to 'eglot-server-programs'. 98 99 - nls (bug#63603) 100 - nixd (bug#64214) 101 - lexical (bug#65359) 102 - terraform-ls (bug#65671) 103 - ruff-lsp (bug#67441) 104 - uiua (bug#67850) 105 106 107 * Changes in Eglot 1.15 (29/4/2023) 108 109 ** Fix LSP "languageId" detection 110 111 Many servers today support multiple languages, meaning they can handle 112 more than one file type in the same connection. This relies on the 113 client supplying a ':languageId' string. Previously, Eglot calculated 114 this string based on an imperfect heuristic and was often wrong. See 115 github#1206. 116 117 ** Fix problems with missing signature documentation (bug#62687) 118 119 ** Reworked 'eglot-imenu' 120 121 Eglot's Imenu backend (used for M-x imenu among other extensions), has 122 been reworked. Most newer servers respond to 123 'textDocument/documentSymbol' with a vector of 'DocumentSymbol', not 124 'SymbolInformation'. It's not worth it trying to make the two formats 125 resemble each other. This also lays groundwork supporting a 126 forthcoming "breadcrumb" feature of bug#58431. 127 128 ** New command 'eglot-update' 129 130 This allows users to easily update to the latest version of Eglot. 131 132 133 * Changes in Eglot 1.14 (3/4/2023) 134 135 ** Faster, more responsive completion 136 137 Eglot takes advantage of LSP's "isIncomplete" flag in responses to 138 completion requests to drive new completion-caching mechanism for the 139 duration of each completion session. Once a full set of completions 140 is obtained for a given position, the server needn't be contacted in 141 many scenarios, resulting in significantly less communication 142 overhead. This works with the popular Company package and stock 143 completion-at-point interfaces. 144 145 A variable 'eglot-cache-session-completions', t by default, controls 146 this. The mechanism was tested with ccls, jdtls, pylsp, golsp and 147 clangd. Notably, the C/C++ language server Clangd version 15 has a 148 bug in its "isIcomplete" flag (it is fixed in later versions). If you 149 run into problems, disable this mechanism like so: 150 151 (add-hook 'c-common-mode-hook 152 (lambda () (setq-local eglot-cache-session-completions nil))) 153 154 ** At-point documentation less obtrusive in echo area 155 156 Eglot takes advantage of new features of ElDoc to separate short 157 documentation strings from large ones, sending the former to be shown in 158 the ElDoc's echo area and the latter to be shown in other outlets, 159 such as the *eldoc* buffer obtainable with 'C-h .'. 160 161 ** New variable 'eglot-prefer-plaintext' 162 163 Customize this to t to opt-in to docstrings in plain text instead of 164 Markdown. 165 166 (bug#61373) 167 168 ** Progress indicators inhabit the mode-line by default 169 170 To switch to the echo area, customize 'eglot-report-progress' to 171 'messages'. To switch off progress reporting completely, set to nil. 172 173 ** Snippet support is easier to enable 174 175 The user needn't manually activate 'yas-minor-mode' or 176 'yas-global-mode'. If YASnippet is installed and the server supports 177 snippets, it is used automatically, unless the symbol 'yasnippet' has 178 been added to 'eglot-stay-out-of'. 179 180 181 * Changes in Eglot 1.13 (15/03/2023) 182 183 ** ELPA installations on Emacs 26.3 are supported again. 184 185 186 * Changes in Eglot 1.12.29 (Eglot bundled with Emacs 29.1) 187 188 ** Eglot has a new command to upgrade to the latest version. 189 190 The new command 'eglot-upgrade-eglot' allows easily grabbing the 191 latest version of Eglot from ELPA. This might be more convenient than 192 using the more general command 'package-install', which by default 193 will not upgrade "built-in" packages, those that come with Emacs. 194 195 196 * Changes in Eglot 1.12 (13/03/2023) 197 198 ** LSP inlay hints are now supported. 199 Inlay hints are small text annotations not unlike diagnostics, but 200 designed to help readability instead of indicating problems. For 201 example, a C++ LSP server can serve hints about positional parameter 202 names in function calls and a variable's automatically deduced type. 203 Emacs can display these hints using overlays, helping the user 204 remember those types and parameter names. 205 206 ** Longstanding Tramp instability issues solved. 207 The solution involves a Tramp-specific workaround in Eglot. Future 208 Tramp versions will have this problem solved at the origin. The 209 workaround will then be removed. Emacs bug#61350 has more details. 210 211 (github#859, github#1020, github#883) 212 213 ** LSP's 'positionEncoding' capability is now supported. 214 The position-encoding scheme (UTF-8, UTF-16 or UTF-32) can now 215 be negotiated with the server. 216 217 ** More of the user's Eldoc configuration is respected. 218 This change addresses the problems reported in many Eglot reports 219 dating back to early 2021 at least. 220 221 (github#646, github#894, github#920, github#1031, github#1171). 222 223 This is unfinished work, as 'eldoc-documentation-strategy' is still 224 set by Eglot during its tenure over a buffer. The default value for 225 it cannot work reasonably with Eglot's additions to 226 'eldoc-documentation-functions'. 227 228 ** Completion labels are correctly displayed in servers like clangd. 229 230 (github#1141) 231 232 ** Assorted bugfixes. 233 234 (bug#61312, bug#61478, bug#61532, bug#61726, bug#61866, bug#61748) 235 236 237 * Changes in Eglot 1.11 (27/1/2023) 238 239 ** New server vscode-json-languageserver added to 'eglot-server-programs'. 240 241 (bug#60198) 242 243 ** Assorted bugfixes. 244 245 (bug#60379, bug#60557, (bug#61048) 246 247 248 * Changes in Eglot 1.10 (16/12/2022) 249 250 ** Emacs progress reporters are used for LSP progress notifications. 251 (bug#59149) 252 253 ** LSP reported URIs other than file:// are passed on to Emacs. 254 This change allows other URI handlers, such as a 'jar:' handling 255 package, to cooperate with Eglot and find files inside compressed file 256 systems (bug#58790). 257 258 ** Eglot now shows in the menu bar. 259 260 ** Tree-sitter modes added to 'eglot-server-programs'. 261 These modes are usually handled by the same server that handles the 262 "classical mode". 263 264 ** New servers csharp-ls and texlab added to 'eglot-server-programs'. 265 266 ** Assorted bugfixes. 267 (bug#59824, bug#59338) 268 269 270 * Changes in Eglot 1.9 (8/10/2022) 271 272 This is the last release before integration into Emacs's core. 273 274 ** New 'M-x eglot-list-connections' command. 275 Probably not very useful for now. More keybindings and clickable 276 shortcuts to connection-specific commands to be added later. 277 278 ** Manual temporarily lives in separate MANUAL.md file. 279 The manual has been rewritten mostly from scratch. It is structured 280 hierarchically and is more complete. After the merge into Emacs, the 281 Eglot Texinfo manual bundled with Emacs used this temporary manual as 282 a starting point. 283 284 ** Support for "single server, multiple modes". 285 Previously, if an entry such as '((c++-mode c-mode) . ("clangd)")' was 286 found in 'eglot-server-programs', it meant that '.cpp' files '.c' 287 files would lead to two 'clangd' instances for managing them, even if 288 these files were in the same project. Now only one is created. It is 289 assumed that most, if not all, servers configured in 290 'eglot-server-programs' handle this correctly. 291 292 (github#681) 293 294 ** 'eglot-imenu' no longer uses problematic "special elements". 295 Though Eglot's 'eglot-imenu' returned a fully compliant 'imenu' 296 structure, that object was not understood by many other frontends 297 other than 'M-x imenu' itself. Since the special functionality it 298 enabled wasn't being used anyway, it was decided to remove it to fix 299 these longstanding problems. 300 301 (github#758, github#536, github#535) 302 303 ** 'eglot-workspace-configuration' has been overhauled. 304 This variable and its uses are now more thoroughly documented. It can 305 be set to a function for dynamic calculation of the configuration. 306 The preferred format is a plist, though the earlier alist format is 307 still supported. 308 309 (github#967, github#590, github#790) 310 311 ** 'C-u M-.' lists and completes arbitrary workspace symbols. 312 A very old request, now made possible by a relatively recent change to 313 the 'workspace/symbol' RPC method. 314 315 (github#131) 316 317 ** Reworked mode-line menus. 318 New menus help discover Eglot's features and show which of them are 319 supported by the current server. Menus can be customized away via 320 'eglot-menu-string', making space in mode-line. 321 322 (github#792) 323 324 ** Easier to use LSP 'initialize.initializationOptions'. 325 In 'eglot-server-programs' a plist may be appended to the usual list 326 of strings passed as command line arguments. The value of its 327 ':initializationOptions' key constructs the corresponding LSP JSON 328 object. This may be easier than creating a 'defclass' for a specific 329 server and specializing 'eglot-initialization-options' to that class. 330 331 (github#901, github#845, github#940) 332 333 ** LSP on-type formatting is now supported. 334 This is the 'documentOnTypeFormattingProvider' LSP capability, which 335 may be disabled via 'eglot-ignored-server-capabilities' 336 337 (github#899) 338 339 ** Basic LSP "workspace folders" support added. 340 Eglot now advertises 'project-root' and 'project-external-roots' as 341 workspace-folders. (Configuring 'project-vc-external-roots-function' 342 via Elisp or 'tags-table-list' via Customize are two ways to set the 343 external roots of a simple git project.) 344 345 (github#893) 346 347 ** Eglot can now show project wide diagnostics via Flymake. 348 Some LSP servers report diagnostics for all files in the current 349 workspace. Flymake has (as of version 1.2.1) the option to show 350 diagnostics from buffers other than the currently visited one. The 351 command 'M-x flymake-show-project-diagnostics' will now show all the 352 diagnostics relevant to a workspace. 353 354 (github#810) 355 356 ** Support LSP completion tags. 357 An LSP completion tag can be used to tell the editor how to render a 358 completion. Presently, one kind of tag exists, denoting its 359 corresponding completion as obsolete. 360 361 (github#797) 362 363 ** Support LSP optional diagnostic tags. 364 A diagnostic tag can indicate either "unused or unnecessary code" or 365 "deprecated or obsolete code". Following the rendering suggestions in 366 the protocol, we fade out unnecessary code and strike-through 367 deprecated code. 368 369 (github#794) 370 371 ** The Rust language server is now rust-analyzer by default. 372 Eglot will now prefer starting "rust-analyzer" to "rls" when it is 373 available. The special support code for RLS has been removed. 374 375 (github#803) 376 377 ** New servers have been added to 'eglot-server-programs'. 378 - clojure-lsp (github#813) 379 - racket-langserver (github#694) 380 - futhark lsp (github#922) 381 - purescript-language-server (github#905) 382 - Perl::LanguageServer (github#952) 383 - marksman (github#1013) 384 - jedi-language-server ([#994](github#994)) 385 386 387 * Changes in Eglot 1.8 (12/1/2022) 388 389 ** Alternate servers supported out-of-box for the same major mode. 390 In practice, this removes the need for Eglot to "officially" bless one 391 server over another. 392 393 Do not confuse this feature with another missing feature which 394 consists of supporting multiple servers simultaneously managing a 395 major mode within a project. 396 397 (github#688) 398 399 ** TRAMP support added. 400 There are no variables to customize: visit a remote file, ensure the 401 server also exists in the remote, and type "M-x eglot". 402 403 (github#637, github#463, github#84) 404 405 ** 'eglot-ignored-server-capabilities' is now correctly spelled. 406 This user-visible variable used to be spelled 407 'eglot-ignored-server-capabilites', which is still a valid but 408 obsolete name. 409 410 (github#724) 411 412 ** Eglot can manage cross-referenced files outside project. 413 This is activated by a new customization option 414 'eglot-extend-to-xref', which defaults to nil. 415 416 (github#76, github#686, github#695) 417 418 ** Code action shortcuts can be added by the user. 419 'M-x eglot-code-actions' accepts an optional 'action-kind' argument, 420 specified interactively with 'C-u'. Other shortcuts call specific 421 actions directly ('eglot-code-action-inline', 422 'eglot-code-action-extract', 'eglot-code-action-rewrite', 423 'eglot-code-action-organize-imports' and 424 'eglot-code-action-quickfix'). One can create one's own shortcuts for 425 code actions with specific a kind by calling 'eglot-code-actions' from 426 Lisp. 427 428 (github#411) 429 430 ** New command 'eglot-shutdown-all added. 431 This disconnects all the Eglot connections in the user's session. 432 433 (github#643) 434 435 ** New variable 'eglot-withhold-process-id' added. 436 If non-nil, Eglot will not send the Emacs process ID to the language 437 server. This can be useful when using docker to run a language 438 server. 439 440 (github#722) 441 442 ** Several new servers have been added to 'eglot-server-programs'. 443 - cmake-language-server (github#787) 444 - css-languageserver (github#204, github#769) 445 - fortls (github#603) 446 - html-languageserver (github#204, github#769) 447 - json-languageserver (github#204, github#769) 448 - lua-lsp (github#721) 449 - mint ls (github#750) 450 - pyright (github#742) 451 - vim-language-server (github#787) 452 - yaml-language-server (github#751) 453 - zls (github#646) 454 455 456 * Changes in Eglot 1.7 (16/12/2020) 457 458 ** Hierarchical symbols are supported in Imenu. 459 (github#303). 460 461 ** Multiple "documentation at point" sources are supported. 462 Such sources include as LSP's signature, hover and also the Flymake 463 diagnostic messages. They can all be presented in the echo area 464 (space permitting), or via 'C-h .'. For now, composition of different 465 sources can be customized using 'eldoc-documentation-strategy', 466 'eldoc-echo-area-use-multiline-p' and 'eldoc-prefer-doc-buffer'. 467 468 The variables 'eglot-put-doc-in-help-buffer' and 469 'eglot-auto-display-help-buffer' have been removed. 470 471 (github#439, github#494, github#481, github#454) 472 473 474 * Changes in Eglot 1.6 (16/04/2020) 475 476 ** Column offset calculation is now LSP-conformant. 477 It seems the majority of servers now comply with the language server 478 specification when it comes to handling non-ASCII texts. Therefore 479 the default values of 'eglot-move-to-column-function' and 480 'eglot-current-column-function' have been changed. Consult the 481 documentation of these variables for how to restore the old behavior. 482 483 (github#361) 484 485 ** LSP workspace/configuration requests are supported. 486 Also a new section "Per-project server configuration" in the README.md 487 should answer some FAQ's in this regard. 488 489 (github#326) 490 491 492 * Changes in Eglot 1.5 (20/10/2019) 493 494 ** Eglot takes over Company configuration. 495 Similar to what was already the case with Flymake, Eldoc and Xref, use 496 just the backend that can do something useful in Eglot, 497 'company-capf'. See 'eglot-stay-out-of' to opt out of this. 498 499 (github#324) 500 501 ** New option 'eglot-autoshutdown' added. 502 This disconnects the server after last managed buffer is killed. 503 504 (github#217, github#270) 505 506 ** Completion support has been fixed. 507 Among other things, consider LSP's "filterText" cookies, which enable 508 a kind of poor-man's flex-matching for some backends. 509 510 (github#235, github#313, github#311, github#279) 511 512 ** Supports LSP's "goto declaration/implementation/typeDefinition". 513 514 (github#302) 515 516 ** New option 'eglot-send-changes-idle-time' added. 517 518 (github#258) 519 520 ** Eglot's Eldoc no longer flickers when moving around. 521 522 (github#198) 523 524 ** Large docs shown in help buffer instead of echo area by default. 525 Also add two new customization variables 526 'eglot-put-doc-in-help-buffer' and 'eglot-auto-display-help-buffer'. 527 528 (github#198) 529 530 ** Built-in support for Go, Elixir and Ada added. 531 532 (github#304, github#264, github#316) 533 534 535 * Changes in Eglot 1.4 (5/1/2019) 536 537 ** Parameter highlighting in the first line of signature corrected. 538 539 ** Markdown documentation strings are rendered with faces. 540 Eglot uses 'gfm-view-mode' for this. 541 542 ** Hard dependencies on Flymake have been removed. 543 The user can turn Flymake off now in buffers managed by Eglot. 544 545 ** Connection hooks are run with proper directory local variables. 546 This fixes issues with suspiciously empty 'didChangeConfiguration' 547 messages that are supposed to communicate parameters from a 548 directory-set 'eglot-workspace-configuration'. 549 550 (github#196) 551 552 ** Completion sorting has been fixed. 553 If the server returns completions in some sensible order, Eglot will 554 keep it. 555 556 (github#190) 557 558 ** Flymake and Eldoc taken over completely while managing buffers. 559 No longer try to add Eglot's facilities to existing facilities in 560 these two domains. 561 562 563 * Changes in Eglot 1.3 (10/12/2018) 564 565 ** Provide strict checking of incoming LSP messages. 566 567 (github#144, github#156) 568 569 ** Add brief context after 'xref-find-references' when available. 570 571 (github#52) 572 573 ** Support 'completionContext' to help servers like 'ccls'. 574 575 ** Use Flymake from GNU ELPA. 576 577 (github#178) 578 579 580 * Changes in Eglot 1.2 (23/11/2018) 581 582 ** Support snippet completions. 583 Eglot uses 'yasnippet.el' for this, if it is installed. 584 585 (github#50) 586 587 ** 'workspace/didChangeConfiguration' implemented. 588 589 (github#29) 590 591 ** Handle experimental/unknown server methods gracefully. 592 593 (github#39) 594 595 ** Accept functions as entries in 'eglot-server-programs'. 596 'CONTACT' in the '(MAJOR-MODE . CONTACT)' association in 597 'eglot-server-programs' can now be a function of no arguments 598 producing any value previously valid for a contact. Functions can be 599 interactive or non-interactive. 600 601 (github#63) 602 603 ** Improve completion to be snappier and don't hinder typing. 604 605 (github#61) 606 607 ** Consider ':triggerCharacters' in company completion. 608 609 (github#80) 610 611 ** Add support for LSP 'TextEdit' objects in completion. 612 613 ** Prefer ccls over cquery for C/C++ 614 615 (github#94) 616 617 ** 'eglot-ignored-server-capabilites' is more user-friendly. 618 619 (github#126) 620 621 ** Supports asynchronous connections. 622 If a connection to the server is taking too long, is will continue in 623 the background. A new defcustom 'eglot-sync-connect' controls this 624 feature. 625 626 (github#68) 627 628 ** The 'eglot-shutdown' command prompts for the server to shutdown. 629 630 (github#73) 631 632 ** Add support for the Eclipse JDT language server. 633 634 (github#63) 635 636 ** Add out-of-the-box support for Haskell, Kotlin, Go, Ocaml, R. 637 638 ** Add the ability to move to LSP-precise columns. 639 Some servers like 'clangd' follow the UTF-16-based spec very closely 640 here. 641 642 (github#124) 643 644 ** Fix a potential security issue fontifying LSP doc. 645 646 (github#154) 647 648 ** Fix many, many bugs 649 650 (github#44, github#48, github#54, github#58, github#64, github#74, 651 github#81, github#82, github#86, github#87, github#83, github#93, 652 github#100, github#115, github#120, github#121, github#126, 653 github#138, github#144, github#158, github#160, github#167) 654 655 656 * Changes in Eglot 1.1 (9/7/2018) 657 658 ** Implement TCP autostart/autoconnect (and support Ruby's Solargraph). 659 The ':autoport' symbol in the server invocation is replaced 660 dynamically by a local port believed to be vacant, so that the ensuing 661 TCP connection finds a listening server. 662 663 ** Eglot now depends on Emacs library 'jsonrpc.el'. 664 665 666 ---------------------------------------------------------------------- 667 This file is part of GNU Emacs. 668 669 GNU Emacs is free software: you can redistribute it and/or modify 670 it under the terms of the GNU General Public License as published by 671 the Free Software Foundation, either version 3 of the License, or 672 (at your option) any later version. 673 674 GNU Emacs is distributed in the hope that it will be useful, 675 but WITHOUT ANY WARRANTY; without even the implied warranty of 676 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 677 GNU General Public License for more details. 678 679 You should have received a copy of the GNU General Public License 680 along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. 681 682 683 Local Variables: 684 bug-reference-bug-regexp: "\\(\\(github\\|bug\\)#\\([0-9]+\\)\\)" 685 bug-reference-url-format: eglot--debbugs-or-github-bug-uri 686 paragraph-separate: "[ ]" 687 End: 688