mirror of
https://github.com/danbulant/monaco-yaml
synced 2026-06-21 23:52:14 +00:00
Add support for document symbol details
This is set to the raw value for primitives by the YAML language service. The demo now uses this value as the title attribute on the breadcrumbs. Closes #137
This commit is contained in:
parent
545e6a6bc4
commit
3a873e083c
2 changed files with 2 additions and 1 deletions
|
|
@ -184,6 +184,7 @@ ed.onDidChangeCursorPosition(async (event) => {
|
|||
breadcrumb.setAttribute('role', 'button');
|
||||
breadcrumb.classList.add('breadcrumb');
|
||||
breadcrumb.textContent = symbol.name;
|
||||
breadcrumb.title = symbol.detail;
|
||||
if (symbol.kind === languages.SymbolKind.Array) {
|
||||
breadcrumb.classList.add('array');
|
||||
} else if (symbol.kind === languages.SymbolKind.Module) {
|
||||
|
|
|
|||
|
|
@ -341,7 +341,7 @@ function toSymbolKind(kind: ls.SymbolKind): languages.SymbolKind {
|
|||
|
||||
function toDocumentSymbol(item: ls.DocumentSymbol): languages.DocumentSymbol {
|
||||
return {
|
||||
detail: '',
|
||||
detail: item.detail || '',
|
||||
range: toRange(item.range),
|
||||
name: item.name,
|
||||
kind: toSymbolKind(item.kind),
|
||||
|
|
|
|||
Loading…
Reference in a new issue