Commands and shortcuts
Plugin commands
- Restart Servers: kills all language servers belonging to the active window
- This command only works when in a supported document.
- It may change in the future to be always available, or only kill the relevant language server.
- LSP Settings: Opens package settings.
Document actions
- Show Code Actions:
super+.
- Symbol References:
shift+f12
- Rename Symbol: UNBOUND
- Recommendation: Override
F2
(next bookmark)
- Recommendation: Override
- Go to definition / type definition / declaration / implementation: UNBOUND
- Recommendation: Override
f12
(built-in goto definition), - LSP falls back to ST3's built-in goto definition command in case LSP fails.
- Recommendation: Override
- Format Document: UNBOUND
- Format Selection: UNBOUND
- Document Symbols: UNBOUND
Workspace actions
- Show Diagnostics Panel:
super+shift+M
/ctr+alt+M
- Next/Previous Diagnostic From panel:
F4
/shift+F4
- Workspace Symbol Search: via command Palette
LSP: workspace symbol
Overriding keybindings
Sublime's keybindings can be edited from the Preferences: Key Bindings
command.
The following example overrides f12
to use LSP's go to definition when in javascript/typescript:
{
"keys": ["f12"],
"command": "lsp_symbol_definition",
"context": [
{
"key": "selector",
"operator": "equal",
"operand": "source.ts, source.js"
}
]
}
More useful keybindings (OS-X), edit Package Settings -> LSP -> Key Bindings
{ "keys": ["f2"], "command": "lsp_symbol_rename" },
{ "keys": ["f12"], "command": "lsp_symbol_definition" },
{ "keys": ["super+option+r"], "command": "lsp_document_symbols" },
{ "keys": ["super+option+h"], "command": "lsp_hover"}
Mouse map configuration
See below link, but bind to lsp_symbol_definition
command
https://stackoverflow.com/questions/16235706/sublime-3-set-key-map-for-function-goto-definition
Configuring
Sublime settings
Add these settings to your Sublime settings, Syntax-specific settings and/or in Project files.
lsp_format_on_save
false
run the server's formatProvider (if supported) on a document before saving.
Package settings (LSP)
complete_all_chars
true
request completions for all characters, not just trigger charactersonly_show_lsp_completions
false
disable sublime word completion and snippets from autocomplete listscompletion_hint_type
"auto"
override automatic completion hints with "detail", "kind" or "none"show_references_in_quick_panel
false
show symbol references in Sublime's quick panel instead of the bottom panelshow_view_status
true
show permanent language server status in the status barauto_show_diagnostics_panel
always
(never
,saved
) open the diagnostics panel automatically if there are diagnosticsshow_diagnostics_count_in_view_status
false
show errors and warnings count in the status barshow_diagnostics_in_view_status
true
when on a diagnostic with the cursor, show the text in the status bardiagnostics_highlight_style
"underline"
highlight style of code diagnostics,"underline"
or"box"
highlight_active_signature_parameter
: highlight the active parameter of the currently active signaturedocument_highlight_style
: document highlight style: "underline", "stippled", "squiggly" or ""document_highlight_scopes
: customize your sublime text scopes for document highlightingdiagnostics_gutter_marker
"dot"
gutter marker for code diagnostics: "dot", "circle", "bookmark", "cross" or ""show_code_actions_bulb
false
show a bulb in the gutter when code actions are availableshow_symbol_action_links
false
show links to symbol actions like go to, references and rename in the hover popupdisabled_capabilities
,[]
*Turn off client capabilities (features): "hover", "completion", "documentHighlight", "colorProvider", "signatureHelp"log_debug
false
show debug logging in the sublime consolelog_server
true
show server/logMessage notifications from language servers in the consolelog_stderr
false
show language server stderr output in the consolelog_payloads
false
show full JSON-RPC responses in the console