commands: executeDocumentSymbolProvider

This commit is contained in:
Johannes Rieken
2015-11-27 16:08:52 +01:00
parent 67084502b5
commit 893a78374d
5 changed files with 160 additions and 54 deletions

View File

@@ -72,20 +72,10 @@ class OutlineAdapter implements IOutlineSupport {
let doc = this._documents.getDocument(resource);
return asWinJsPromise(token => this._provider.provideDocumentSymbols(doc, token)).then(value => {
if (Array.isArray(value)) {
return value.map(OutlineAdapter._convertSymbolInfo);
return value.map(TypeConverters.SymbolInformation.toOutlineEntry);
}
});
}
private static _convertSymbolInfo(symbol: vscode.SymbolInformation): IOutlineEntry {
return <IOutlineEntry>{
type: TypeConverters.fromSymbolKind(symbol.kind),
range: TypeConverters.fromRange(symbol.location.range),
containerLabel: symbol.containerName,
label: symbol.name,
icon: undefined,
};
}
}
class CodeLensAdapter implements modes.ICodeLensSupport {