Skip to content

Capabilities#

Implementation Status#

Below are all the currently supported LSP capabilities and their implementation status:

capability done notes
initialize
initialized
shutdown
exit
$/cancelRequest
$/progress
window/showMessage
window/showMessageRequest
window/logMessage
window/workDoneProgress/create
window/workDoneProgress/cancel
telemetry/event
client/registerCapability
client/unregisterCapability
workspace/workspaceFolders
workspace/didChangeWorkspaceFolders
workspace/didChangeConfiguration Currently does nothing but log
workspace/configuration
workspace/didChangeWatchedFiles
workspace/symbol
workspace/executeCommand See Extra capabilities
workspace/applyEdit TextDocumentEdit and RenameFile only
textDocument/didOpen
textDocument/didChange
textDocument/willSave
textDocument/willSaveWaitUntil
textDocument/didSave Do nothing currently
textDocument/didClose
textDocument/publishDiagnostics
textDocument/completion
completionItem/resolve
textDocument/hover
textDocument/signatureHelp Missing support for active parameter ATM
textDocument/declaration
textDocument/definition TODO: Find java classes definition
textDocument/typeDefinition
textDocument/implementation
textDocument/references
textDocument/documentHighlight
textDocument/documentSymbol
textDocument/codeAction
codeAction/resolve
textDocument/codeLens
codeLens/resolve
textDocument/documentLink
documentLink/resolve
textDocument/documentColor
textDocument/colorPresentation
textDocument/formatting
textDocument/rangeFormatting
textDocument/onTypeFormatting
textDocument/rename
textDocument/prepareRename
textDocument/foldingRange
textDocument/selectionRange
textDocument/semanticTokens/full
textDocument/semanticTokens/full/delta
textDocument/semanticTokens/range
workspace/semanticTokens/refresh
workspace/codeLens/refresh
textDocument/linkedEditingRange
textDocument/prepareCallHierarchy
callHierarchy/incomingCalls
callHierarchy/outgoingCalls
textDocument/moniker

Extra capabilities#

Besides LSP official capabilities, clojure-lsp has some extra features:

Refactorings#

It should be possible to introduce most of the refactorings here


More details#

Calling executeCommand with the following commands and additional args will notify the client with applyEdit. All commands expect the first three args to be [document-uri, line, column] (eg ["file:///home/snoe/file.clj", 13, 11])

done command args notes
add-import-to-namespace [document-uri, line, column, import-name]
add-missing-libspec
clean-ns
cycle-coll
cycle-privacy
expand-let
extract-function [document-uri, line, column, function-name]
inline-symbol
introduce-let [document-uri, line, column, binding-name]
move-to-let [document-uri, line, column, binding-name]
thread-first
thread-first-all
thread-last
thread-last-all
unwind-all
unwind-thread
resolve-macro-as [document-uri, line, column, resolved-full-symbol kondo-config-path]

See Vim client section for an example.

Emacs provides all those refactorings via lsp-mode with the lsp-clojure- prefix.

Other clients might provide a higher level interface to workspace/executeCommand you need to pass the path, line and column numbers.

Custom methods#

clojure-lsp has some custom LSP methods that doesn't follow the protocol but aggregate value as a clojure IDE:

command args notes
clojure/serverInfo/raw Use to retrieve from server the server configuration information
clojure/serverInfo/log Use to log to user the server configuration information
clojure/cursorInfo/log [document-uri, line, column] Use to log to user the debugging information for the symbol at cursor

Last update: September 19, 2021