this post was submitted on 19 Oct 2023
1 points (100.0% liked)

Emacs

312 readers
3 users here now

A community for the timeless and infinitely powerful editor. Want to see what Emacs is capable of?!

Get Emacs

Rules

  1. Posts should be emacs related
  2. Be kind please
  3. Yes, we already know: Google results for "emacs" and "vi" link to each other. We good.

Emacs Resources

Emacs Tutorials

Useful Emacs configuration files and distributions

Quick pain-saver tip

founded 1 year ago
MODERATORS
 

For speed, I wish to disable everything that a language server (in this case clangd) provides *except* for code completion. I use eglot. How would I do this?

PS: No I don't want to use lsp-bridge because I want my own custom completion style.

top 2 comments
sorted by: hot top controversial new old
[–] --_II_--@alien.top 1 points 1 year ago

Eglot has a feature that allows you to customize the capabilities of a server. You can use eglot-server-programs to do this. Just specify the server and capabilities you want in a cons cell, like (eglot-server-programs '((c++-mode . ("clangd" "--background-index" "--clang-tidy" "--completion-style=detailed")))). Here, the --completion-style=detailed is just an example, replace it with your custom completion style.

[–] Azkae@alien.top 1 points 1 year ago

I'm not sure what you want to disable exactly but you should look at eglot-ignored-server-capabilities:

For example to disable inlay hints: (setq eglot-ignored-server-capabilities '(:inlayHintProvider)).

Here is the complete list of server capabilities:

          (const :tag "Documentation on hover" :hoverProvider)
          (const :tag "Code completion" :completionProvider)
          (const :tag "Function signature help" :signatureHelpProvider)
          (const :tag "Go to definition" :definitionProvider)
          (const :tag "Go to type definition" :typeDefinitionProvider)
          (const :tag "Go to implementation" :implementationProvider)
          (const :tag "Go to declaration" :declarationProvider)
          (const :tag "Find references" :referencesProvider)
          (const :tag "Highlight symbols automatically" :documentHighlightProvider)
          (const :tag "List symbols in buffer" :documentSymbolProvider)
          (const :tag "List symbols in workspace" :workspaceSymbolProvider)
          (const :tag "Execute code actions" :codeActionProvider)
          (const :tag "Code lens" :codeLensProvider)
          (const :tag "Format buffer" :documentFormattingProvider)
          (const :tag "Format portion of buffer" :documentRangeFormattingProvider)
          (const :tag "On-type formatting" :documentOnTypeFormattingProvider)
          (const :tag "Rename symbol" :renameProvider)
          (const :tag "Highlight links in document" :documentLinkProvider)
          (const :tag "Decorate color references" :colorProvider)
          (const :tag "Fold regions of buffer" :foldingRangeProvider)
          (const :tag "Execute custom commands" :executeCommandProvider)
          (const :tag "Inlay hints" :inlayHintProvider)