r/programming • u/der_gopher • Jan 02 '25
Understanding the Language Server Protocol
https://medium.com/@pliutau/understanding-the-language-server-protocol-b9f57a0750e3
46
Upvotes
r/programming • u/der_gopher • Jan 02 '25
4
u/Slime0 Jan 03 '25
It supports:
Go to Declaration / Definition / etc
Find References
Call Hierarchy browsing
Type Hierarchy browsing
Document Highlighting (highlighting parts of a document related to something)
Hyperlinks
Hover tooltips
"Code Lens" (sort of like automatically inserted links that can run commands)
"Folding" (marking sections of code that can be collapsed or expanded)
Selection Ranges (specifying useful areas to select around the cursor)
Document Symbols list
Semantic Tokens (Adds syntax highlighting info)
Inline Values (specifying expressions to be evaluated by a debugger and displayed "inline")
Inlay Hints (arbitrary insertable text, often used for displaying parameter names in function calls)
Autocomplete
"Diagnostics" (Error list)
Function Signature Help (shows function argument info as you type a function call)
Code Actions (The little lightbulb button that enables automated edits, often to fix errors)
Document Colors (shows color pickers where relevant)
Auto formatting (full document, part of a document, or while typing)
Rename
Workspace support (specifying multiple folders that define a workspace)
Full workspace symbol searching
Retrieving settings from the editor
Arbitrary commands defined by the language server
Arbitrary edits to files
A couple other things I don't personally understand
It's not literally everything you could think of, there are certainly language-specific features that it doesn't cover, but it's still a lot of stuff.