LSP configuration¶
The [lsp] configuration file section provides settings to
fine-tune the LSP editors integration.
Completion¶
Customize how completion items appear in your editor when auto-completing links
with the [lsp.completion] sub-section.
Setting |
Type |
Description |
|---|---|---|
|
|
Label displayed in the completion pop-up for each note |
|
|
Text used as a source when filtering the completion pop-up with keystrokes |
|
|
Additional information about a completion item |
|
|
Indicates whether |
Each key accepts a template with the following context:
Variable |
Type |
Description |
|---|---|---|
|
string |
Filename of the note, including its extension |
|
string |
Filename of the note without the file extension |
|
string |
File path to the note, relative to the notebook root |
|
string |
Absolute file path to the note |
|
string |
File path to the note, relative to the current directory |
|
string |
Note title |
|
string |
Note title or path if empty |
|
map |
YAML frontmatter metadata, e.g. |
YAML keys are normalized to lower case.
Diagnostics¶
Use the [lsp.diagnostics] sub-section to configure how LSP diagnostics are
reported to your editors. Each diagnostic setting can be:
An empty string or
noneto ignore this diagnostic.hint,info,warningorerrorto enable and set the severity of the diagnostic.
Setting |
Default |
Description |
|---|---|---|
|
|
Report titles of wiki-links, which is useful if you use IDs for filenames |
|
|
Warn for dead links between notes |
|
|
Warn when a note links to itself |
|
|
Warn when another notes link to current note without reciprocal backlinks |
Missing backlink diagnostic¶
The missing-backlink diagnostic warns when other notes link to the current
note but the current note doesn’t link back to them. Unlike other diagnostics,
this one requires a table with two fields:
level: The severity (hint,info,warning, orerror)position: Where to display the diagnostic (top,bottom, orlast-section)
The position values are:
top: First line of the note.bottom: Last line of the note.last-section: The last section heading (falls back to"top").
Example:
[lsp.diagnostics]
missing-backlink = { level = "warning", position = "bottom" }
Complete example¶
[lsp]
[lsp.diagnostics]
# Report titles of wiki-links as hints.
wiki-title = "hint"
# Warn for dead links between notes.
dead-link = "error"
# Warn when a note links to itself.
self-link = "warning"
# Report if backlinks are missing (shown at end of file).
missing-backlink = { level = "hint", position = "bottom" }
[lsp.completion]
# Show the note title in the completion pop-up, or fallback on its path if empty.
note-label = "{{title-or-path}}"
# Filter out the completion pop-up using the note title or its path.
note-filter-text = "{{title}} {{path}}"
# Show the note filename without extension as detail.
note-detail = "{{filename-stem}}"