{"id":13836634,"url":"https://github.com/nemethf/eglot-x","last_synced_at":"2026-01-06T05:54:53.810Z","repository":{"id":45172239,"uuid":"221540748","full_name":"nemethf/eglot-x","owner":"nemethf","description":"Protocol extensions for Eglot","archived":false,"fork":false,"pushed_at":"2024-04-27T16:42:56.000Z","size":418,"stargazers_count":105,"open_issues_count":3,"forks_count":6,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-04-27T17:39:24.337Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Emacs Lisp","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nemethf.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-11-13T19:58:34.000Z","updated_at":"2024-05-30T01:27:16.090Z","dependencies_parsed_at":"2024-02-21T09:43:05.900Z","dependency_job_id":"9a84ac1c-9728-4a73-ad85-db6dcb8e6e7a","html_url":"https://github.com/nemethf/eglot-x","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nemethf%2Feglot-x","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nemethf%2Feglot-x/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nemethf%2Feglot-x/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nemethf%2Feglot-x/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nemethf","download_url":"https://codeload.github.com/nemethf/eglot-x/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245743534,"owners_count":20665118,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-04T15:00:51.442Z","updated_at":"2026-01-06T05:54:53.805Z","avatar_url":"https://github.com/nemethf.png","language":"Emacs Lisp","funding_links":[],"categories":["Emacs Lisp"],"sub_categories":[],"readme":"# Protocol extensions for Eglot\n\n[Eglot][eglot] aims to support the Language Server Protocol, but none\nof its unofficial extensions.  Eglot-x adds support for some of these\nprotocol extensions.\n\nIf you find a bug in Eglot, please, try to reproduce it without\nEglot-x, because Eglot-x substantially modifies Eglot's normal\nbehavior as well.\n\nAdd the following lines to your init file to enable eglot-x\n\n```elisp\n    (with-eval-after-load 'eglot\n      (require 'eglot-x)\n      (eglot-x-setup))\n```\nTo adjust which extensions are enabled:\n\n```\n    M-x customize-group RET eglot-x RET\n```\n\n# Supported extensions\n\n## Files extension\n\nThis [extension][xfiles] allows the client and the server to have\nseparate file systems.  For example, the server can run inside a\nDocker container, or the source code can be on a remote system\naccessed by Tramp.  The client can send files to the server only from\nthe result of `project-files`.  The list of eligible files can further\nlimited by `eglot-x-files-visible-regexp` and\n`eglot-x-files-hidden-regexp`.  This feature works if `project-roots`\nand `project-external-roots` are set correctly.\n\nEnabling extension disables Eglot's built-in support for Tramp\nfiles.\n\n## Additional reference methods\n\nThe command `eglot-x-find-refs' is the entry point for the extra\nmethods.  You can bind it to a key:\n\n```elisp\n    (define-key eglot-mode-map (kbd \"s-.\") #'eglot-x-find-refs)\n```\n\nCurrently, the [`ccls`][ccls-refs] and `rust-analyzer` are the only\nservers whose extra reference methods eglot-x supports.\n\n## Encoding negotiation\n\n[The extension][utf-8-offsets] allows the client and the server to\nnegotiate a proper encoding to be used in transmitting column\npositions.\n\n## rust-analyzer extensions\n\n### experimental extensions\n\n- [Snippet TextEdits]: see variable `eglot-x-enable-snippet-text-edit`.\n- [Join Lines]: see defun `eglot-x-join-lines`.\n- [Move Item]: see defun `eglot-x-move-item-down` and `eglot-x-move-item-up`.\n- [On Enter]: see defun `eglot-x-on-enter`.\n- [Matching Brace]: see `eglot-x-matching-brace`.\n  However, emacs' own `backward-sexp`, and `forward-sexp` seem to be\n  more useful.\n- [Open External Documentation]: see defun `eglot-x-open-external-documentation`.\n- [Local Documentation]: see variable `eglot-x-enable-local-docs-support`.\n- [Structural Search Replace (SSR)][ssr]: see defun `eglot-x-structural-search-replace`.\n\n  The server checks the correctness of the query while you type:\n\n  ![SSR](https://raw.githubusercontent.com/wiki/nemethf/eglot-x/ssr.png)\n\n  The replacement process is similar to `query-replace`:\n\n  ![SSR2](https://raw.githubusercontent.com/wiki/nemethf/eglot-x/ssr-2.png)\n\n- [Workspace Symbols Filtering]: see defun `eglot-x-find-workspace-symbol`.\n\n  The xref buffer shows the current matches while the user iteratively\n  types the query and another buffer shows the location of the first\n  match.\n\n  ![ws-symbol](https://raw.githubusercontent.com/wiki/nemethf/eglot-x/ws-symbol.png)\n\n  Additional input refines the results and the point in main.rs is\n  changed once again to the location of the new first result:\n\n  ![ws-symbol-2](https://raw.githubusercontent.com/wiki/nemethf/eglot-x/ws-symbol-2.png)\n\n  You can change the search scope and kind with `C-l` and `C-M-l`,\n  respectively.  See variable `eglot-x-ws-keymap`.  The non-default\n  settings are shown between braces:\n\n  ![ws-symbol-3](https://raw.githubusercontent.com/wiki/nemethf/eglot-x/ws-symbol-3.png)\n\n  Currently, the xref buffer shows the first lines of the matches.\n  This is not always helpful.\n\n- [Runnables]: see defun `eglot-x-ask-runnables`.\n\n  Results for the whole buffer:\n\n  ![runnables-1](https://raw.githubusercontent.com/wiki/nemethf/eglot-x/runnables.png)\n\n  Selecting the first \"runnable\":\n\n  ![runnables-2](https://raw.githubusercontent.com/wiki/nemethf/eglot-x/runnables-2.png)\n\n  The \"runnable\" is executed as a `compile-command`:\n\n  ![runnables-3](https://raw.githubusercontent.com/wiki/nemethf/eglot-x/runnables-3.png)\n\n- [Server Status]: see variable `eglot-x-enable-server-status`.\n  The mode-line displays the status unless it is \"permanently OK\".\n\n- [Colored diagnostics]: see variable `eglot-x-enable-colored-diagnostics`.\n\n  `flymake-goto-next-error' shows a colored diagnostic message:\n\n  ![colored-diags](https://raw.githubusercontent.com/wiki/nemethf/eglot-x/colored-diags.png)\n\n  (The ansi-color.el of Emacs 27 is too old for this feature, Emacs 29 is OK.)\n\n- Open Server Logs: LSP servers can ask the client to show their logs,\n  see variable `eglot-x-enable-open-server-logs` for details.\n\n### rust-analyzer specific extensions\n- [Expand Macro]: see defun `eglot-x-expand-macro`.\n- [Related Tests]: see defun `eglot-x-ask-related-tests`.\n- [Reload Workspace]: see defun `eglot-x-reload-workspace`.\n- [Rebuild proc-macros]: see defun `eglot-x-rebuild-proc-macros`.\n- [Flycheck commands]: see defuns `eglot-x-run-flycheck`,\n  `eglot-x-clear-flycheck`, and `eglot-x-cancel-flycheck`.  (These\n  commands implement lsp-extensions and have nothing to do with the\n  flycheck Emacs package.)\n- [View Crate Graph]: see variable `eglot-x-graph-type` and defun `eglot-x-view-crate-graph`.\n\n  ![crate-graph](https://raw.githubusercontent.com/wiki/nemethf/eglot-x/view-crate-graph.png)\n\n  You can also jump to the crate (Cargo.toml) if the graph-type is not 'svg':\n\n  ![crate-graph-2](https://raw.githubusercontent.com/wiki/nemethf/eglot-x/view-crate-graph-ascii.png)\n\n  (This command requires [graphviz]/[graph-easy].)\n- [Dependency Tree]: see defun `eglot-x-find-crate`.\n\n- [View Recursive Memory Layout]: the command\n  `eglot-x-view-recursive-memory-layout` shows the memory layout of\n  the thing under point.\n\n  ![view-recursive-memory-layout-1](https://raw.githubusercontent.com/wiki/nemethf/eglot-x/view-recursive-memory-layout-1.png)\n\n  Tooltips show the column names: offset, size, alignement, number of\n  gaps, and gap-size.  The output format is inspired by [pahole],\n  which (I think) more practical than the\n  [upstream graphical output][Upstream memory layout]:\n\n  ![view-recursive-memory-layout-2](https://raw.githubusercontent.com/wiki/nemethf/eglot-x/view-recursive-memory-layout-2.png)\n\n  The built-in outline-minor-mode helps to naviagate / understand a\n  recursive layout.\n\n  A better [layout optimization approach][lwn955709] relies on\n  run-time statistics as well, which this command does not provide.\n\n### rust-analyzer specific extensions for debugging rust-analyzer\n- [Analyzer Status]: see defun `eglot-x-analyzer-status`.\n- [Syntax Tree]: see defun `eglot-x-show-syntax-tree`.\n\n  ![syntax-tree](https://raw.githubusercontent.com/wiki/nemethf/eglot-x/syntax-tree.png)\n\n- [View Hir]: see defun `eglot-x-view-hir`.\n- [View Mir]: see defun `eglot-x-view-mir`.\n- [Interpret Function]: see defun `eglot-x-interpret-function`.\n- [View File Text]: see defun `eglot-x-debug-file-sync-problems`.\n- (Memory Usage): see defun `eglot-x-memory-usage`.\n\n## Taplo specific extensions\n\nRelying on taplo/associatedSchema and taplo/listSchemas\n[extensions][Taplo] eglot-x provides the following commands:\n\n- `eglot-x-taplo-show-associated-schema`\n- `eglot-x-taplo-find-associated-schema`\n- `eglot-x-taplo-list-schemas`\n\n  ![taplo-menu](https://raw.githubusercontent.com/wiki/nemethf/eglot-x/taplo-menu.png)\n\n# Other\n\nEglot-x provides `ff-find-related-file` backends for some LSP servers.\nSee the documentation of `eglot-x-enable-ff-related-file-integration`.\n\n# License\n\n[GPLv3+][gpl]\n\n[Analyzer Status]: https://rust-analyzer.github.io/book/contributing/lsp-extensions.html#analyzer-status\n[Colored diagnostics]: https://rust-analyzer.github.io/book/contributing/lsp-extensions.html#colored-diagnostic-output\n[Dependency Tree]: https://rust-analyzer.github.io/book/contributing/lsp-extensions.html#dependency-tree\n[Expand Macro]: https://rust-analyzer.github.io/book/contributing/lsp-extensions.html#expand-macro\n[Flycheck commands]: https://rust-analyzer.github.io/book/contributing/lsp-extensions.html#controlling-flycheck\n[Interpret Function]: https://rust-analyzer.github.io/book/contributing/lsp-extensions.html#interpret-function\n[Join Lines]: https://rust-analyzer.github.io/book/contributing/lsp-extensions.html#join-lines\n[Local Documentation]: https://rust-analyzer.github.io/book/contributing/lsp-extensions.html#local-documentation\n[Matching Brace]: https://rust-analyzer.github.io/book/contributing/lsp-extensions.html#matching-brace\n[Move Item]: https://rust-analyzer.github.io/book/contributing/lsp-extensions.html#move-item\n[On Enter]: https://rust-analyzer.github.io/book/contributing/lsp-extensions.html#on-enter\n[Open External Documentation]: https://rust-analyzer.github.io/book/contributing/lsp-extensions.html#open-external-documentation\n[Rebuild proc-macros]: https://rust-analyzer.github.io/book/contributing/lsp-extensions.html#rebuild-proc-macros\n[Related Tests]: https://rust-analyzer.github.io/book/contributing/lsp-extensions.html#related-tests\n[Reload Workspace]: https://rust-analyzer.github.io/book/contributing/lsp-extensions.html#reload-workspace\n[Runnables]: https://rust-analyzer.github.io/book/contributing/lsp-extensions.html#runnables\n[Server Status]: https://rust-analyzer.github.io/book/contributing/lsp-extensions.html#server-status\n[Snippet TextEdits]: https://rust-analyzer.github.io/book/contributing/lsp-extensions.html#snippet-textedit\n[Syntax Tree]: https://rust-analyzer.github.io/book/contributing/lsp-extensions.html#syntax-tree\n[Taplo]: https://github.com/tamasfe/taplo/tree/master/crates/taplo-lsp/src/lsp_ext\n[Upstream memory layout]: https://github.com/rust-lang/rust-analyzer/pull/15081\n[View Crate Graph]: https://rust-analyzer.github.io/book/contributing/lsp-extensions.html#view-crate-graph\n[View File Text]: https://rust-analyzer.github.io/book/contributing/lsp-extensions.html#view-file-text\n[View Hir]: https://rust-analyzer.github.io/book/contributing/lsp-extensions.html#view-hir\n[View Mir]: https://rust-analyzer.github.io/book/contributing/lsp-extensions.html#view-mir\n[View Recursive Memory Layout]: https://rust-analyzer.github.io/book/contributing/lsp-extensions.html#view-recursive-memory-layout\n[Workspace Symbols Filtering]: https://rust-analyzer.github.io/book/contributing/lsp-extensions.html#workspace-symbols-filtering\n\n[ccls-refs]: https://github.com/MaskRay/ccls/wiki/LSP-Extensions\n[eglot]: https://github.com/joaotavora/eglot/\n[gpl]: COPYING\n[graph-easy]: https://metacpan.org/dist/Graph-Easy\n[graphviz]: https://graphviz.org/\n[lwn955709]: https://lwn.net/Articles/955709/\n[pahole]: https://manpages.ubuntu.com/manpages/jammy/man1/pahole.1.html\n[ssr]: https://github.com/rust-analyzer/rust-analyzer/blob/master/docs/dev/lsp-extensions.md#structural-search-replace-ssr\n[utf-8-offsets]: https://clangd.github.io/extensions.html#utf-8-offsets\n[xfiles]: https://github.com/sourcegraph/language-server-protocol/blob/master/extension-files.md\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnemethf%2Feglot-x","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnemethf%2Feglot-x","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnemethf%2Feglot-x/lists"}