Home

Awesome

Protocol extensions for Eglot

Eglot aims to support the Language Server Protocol, but none of its unofficial extensions. Eglot-x adds support for some of these protocol extensions.

If you find a bug in Eglot, please, try to reproduce it without Eglot-x, because Eglot-x substantially modifies Eglot's normal behavior as well.

Add the following lines to your init file to enable eglot-x

    (with-eval-after-load 'eglot
      (require 'eglot-x)
      (eglot-x-setup))

To adjust which extensions are enabled:

    M-x customize-group RET eglot-x RET

Supported extensions

Files extension

This extension allows the client and the server to have separate file systems. For example, the server can run inside a Docker container, or the source code can be on a remote system accessed by Tramp. The client can send files to the server only from the result of project-files. The list of eligible files can further limited by eglot-x-files-visible-regexp and eglot-x-files-hidden-regexp. This feature works if project-roots and project-external-roots are set correctly.

Enabling extension disables Eglot's built-in support for Tramp files.

Additional reference methods

The command `eglot-x-find-refs' is the entry point for the extra methods. You can bind it to a key:

    (define-key eglot-mode-map (kbd "s-.") #'eglot-x-find-refs)

Currently, the ccls and rust-analyzer are the only servers whose extra reference methods eglot-x supports.

Encoding negotiation

The extension allows the client and the server to negotiate a proper encoding to be used in transmitting column positions.

rust-analyzer extensions

experimental extensions

rust-analyzer specific extensions

rust-analyzer specific extensions for debugging rust-analyzer

Taplo specific extensions

Relying on taplo/associatedSchema and taplo/listSchemas extensions eglot-x provides the following commands:

Other

Eglot-x provides ff-find-related-file backends for some LSP servers. See the documentation of eglot-x-enable-ff-related-file-integration.

License

GPLv3+