add SymbolInformation.tags, render deprecated items in quick outline and workspace symbol search

This commit is contained in:
Johannes Rieken
2019-08-23 10:25:15 +02:00
parent 87c7042e1d
commit 043a06542d
10 changed files with 52 additions and 38 deletions

View File

@@ -70,8 +70,8 @@ class DocumentSymbolAdapter {
const element = <modes.DocumentSymbol>{
name: info.name || '!!MISSING: name!!',
kind: typeConvert.SymbolKind.from(info.kind),
tags: [],
detail: undefined!, // Strict null override — avoid changing behavior
tags: info.tags && info.tags.map(typeConvert.SymbolTag.from),
detail: '',
containerName: info.containerName,
range: typeConvert.Range.from(info.location.range),
selectionRange: typeConvert.Range.from(info.location.range),

View File

@@ -576,17 +576,20 @@ export namespace WorkspaceSymbol {
return <search.IWorkspaceSymbol>{
name: info.name,
kind: SymbolKind.from(info.kind),
tags: info.tags && info.tags.map(SymbolTag.from),
containerName: info.containerName,
location: location.from(info.location)
};
}
export function to(info: search.IWorkspaceSymbol): types.SymbolInformation {
return new types.SymbolInformation(
const result = new types.SymbolInformation(
info.name,
SymbolKind.to(info.kind),
info.containerName,
location.to(info.location)
);
result.tags = info.tags && info.tags.map(SymbolTag.to);
return result;
}
}

View File

@@ -995,6 +995,7 @@ export class SymbolInformation {
name: string;
location!: Location;
kind: SymbolKind;
tags?: SymbolTag[];
containerName: string | undefined;
constructor(name: string, kind: SymbolKind, containerName: string | undefined, location: Location);