Language Server Protocol
June 10, 2026 ยท View on GitHub
Moe supports LSP but work in progress and not recommended for use yet.
Currently, I tested Nim language server and rust-analyzer.
Please feedback, bug reports and PRs.
Supported LSP commands
Initializeshutdownexitwindow/showMessagewindow/logMessagewindow/workDoneProgress/createworkspace/configurationworkspace/didChangeConfigurationtextDocument/publishDiagnosticstextDocument/didOpentextDocument/didChangetextDocument/didSavetextDocument/didClosetextDocument/hovertextDocument/completiontextDocument/semanticTokens/fullworkspace/semanticTokens/refreshtextDocument/inlayHintworkspace/inlayHint/refreshtextDocument/declarationtextDocument/definitiontextDocument/typeDefinitiontextDocument/implementationtextDocument/referencestextDocument/renametextDocument/prepareCallHierarchycallHierarchy/incomingCallscallHierarchy/outgoingCallstextDocument/documentHighlighttextDocument/documentLinkdocumentLink/resolvetextDocument/codeLensworkspace/codeLens/refreshcodeLens/resolveworkspace/executeCommand$/progress$/cancelRequesttextDocument/foldingRangetextDocument/selectionRangetextDocument/documentSymboltextDocument/signatureHelptextDocument/formatting
Configuration
Please edit you configuration file.
Example
[Lsp]
enable = true
[Lsp.nim]
# File extensions
extensions = ["nim"]
# The LSP server command
command = "nimlangserver"
# The level of verbosity
trace = "verbose"
Configure each language by adding table [Lsp.{languageId}].
If you want to add rust-analyzer,
[Lsp]
enable = true
[Lsp.nim]
extensions = ["nim"]
command = "nimlangserver"
trace = "off"
[Lsp.rust]
extensions = ["rs"]
command = "rust-analyzer"
trace = "messages"
Features
Hover
Press K on the word in Normal mode.
Diagnostics
Results will be received from the LSP server and displayed automatically.
Auto Hover
When Lsp.Diagnostics.autoHover is enabled (default: true), diagnostic messages are automatically shown in a hover popup when the cursor moves onto a diagnostic range. The popup is dismissed when the cursor moves off the diagnostic.
You can also press K to manually show hover information, which will include both diagnostic messages and LSP hover content if available.
The delay before the auto hover popup appears can be configured with Lsp.Diagnostics.autoHoverDelay (default: 300 ms).
[Lsp.Diagnostics]
enable = true
autoHover = true
autoHoverDelay = 300
Signature Help
Ctrl-r in Normal mode. Show the signature help on the hover.
Document Formatting
lspformat in Command mode. Format the buffer.
Folding Range
lspfold in Command mode. Requests folding ranges from the language server and
collapses them all (fold-all), including nested ranges such as a class, its
methods, and their inner blocks. Open them again with zo/zR. Manual folds
created with zf are preserved when running lspfold. The command does nothing
if folding range is disabled in the config or unsupported by the server.
Note
Editing a line inside a collapsed fold (delete, change, paste, insert, a
visual-mode edit, etc.) first reveals the fold and then edits only the
targeted line or range. Unlike Vim, moe does not operate on a closed fold as a
single unit (e.g. dd on a closed fold deletes one line, not the whole fold),
so hidden text is never changed without being shown first. Pure yanks leave
the fold closed. This applies to both LSP and manual (zf) folds.
Selection Range
Ctrl-s in Normal mode. Enter Visual mode and you can repeat it.
Document Symbol
Space-o in Normal mode. You can select a symbol in the list and you can jump.
Completion
The completion is still under development but available.
Semantic Tokens
Syntax highlighting with Semantic Tokens. Currently, only full is supported.
Inlay Hint
Display types at the end of lines with LSP InlayHint.
Inline Value
This is experimental feature. Not tested.
Goto Declaration
gc command in Normal mode. If the file is not currently, it will open in a new window.
Goto Definition
gd command in Normal mode. If the file is not currently, it will open in a new window.
Goto TypeDefinition
gy command in Normal mode. If the file is not currently, it will open in a new window.
Goto Implementation
gi command in Normal mode. If the file is not currently, it will open in a new window.
Find References
gr command in Normal mode. Open References mode.
Call Hierarchy
gh command in Noemal mode. Open Call Hierarchy viewer
Document Highlight
If this feature is enabled, Highlight.currentWord will be forced to disable.
Document Link
gl command in Normal mode. Jump to a target.
Code Lens
Currently, Only supported in rust-analyzer.
Please set true to Lps.CodeLens.enable, Lsp.rust.rustAnalyzerRunSingle, Lsp.rust.rustAnalyzerDebugSingle.
\c command in Normal mode on A code lens line.
Rename
Space-r command in Normal mode. Enter a new name in the command line.
Execute Command
Work in prgoress