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:
Remco Haszing 2021-11-20 12:20:23 +01:00
parent 545e6a6bc4
commit 3a873e083c
No known key found for this signature in database
GPG key ID: 40D9F5FE9155FD3C
2 changed files with 2 additions and 1 deletions

View file

@ -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) {

View file

@ -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),