diff --git a/src/vs/vscode.d.ts b/src/vs/vscode.d.ts index fd657b4bdd7b8..22a0db8c56259 100644 --- a/src/vs/vscode.d.ts +++ b/src/vs/vscode.d.ts @@ -2466,6 +2466,56 @@ declare module 'vscode' { constructor(name: string, kind: SymbolKind, range: Range, uri?: Uri, containerName?: string); } + /** + * Represents programming constructs like variables, classes, interfaces etc. that appear in a document. Document + * symbols can be hierarchical and they have two ranges: one that encloses its definition and one that points to + * its most interesting range, e.g. the range of an identifier. + */ + export class DocumentSymbol { + + /** + * The name of this symbol. + */ + name: string; + + /** + * More detail for this symbol, e.g the signature of a function. + */ + detail: string; + + /** + * The kind of this symbol. + */ + kind: SymbolKind; + + /** + * The range enclosing this symbol not including leading/trailing whitespace but everything else, e.g comments and code. + */ + range: Range; + + /** + * The range that should be selected and reveal when this symbol is being pciked, e.g the name of a function. + * Must be contained by the [`fullRange`](#DocumentSymbol.fullRange). + */ + selectionRange: Range; + + /** + * Children of this symbol, e.g. properties of a class. + */ + children: DocumentSymbol[]; + + /** + * Creates a new document symbol. + * + * @param name The name of the symbol. + * @param detail Details for the symbol. + * @param kind The kind of the symbol. + * @param range The full range of the symbol. + * @param selectionRange The range that should be reveal. + */ + constructor(name: string, detail: string, kind: SymbolKind, range: Range, selectionRange: Range); + } + /** * The document symbol provider interface defines the contract between extensions and * the [go to symbol](https://code.visualstudio.com/docs/editor/editingevolved#_go-to-symbol)-feature. @@ -2480,7 +2530,7 @@ declare module 'vscode' { * @return An array of document highlights or a thenable that resolves to such. The lack of a result can be * signaled by returning `undefined`, `null`, or an empty array. */ - provideDocumentSymbols(document: TextDocument, token: CancellationToken): ProviderResult; + provideDocumentSymbols(document: TextDocument, token: CancellationToken): ProviderResult; } /** diff --git a/src/vs/vscode.proposed.d.ts b/src/vs/vscode.proposed.d.ts index 6068ac4aea7b5..16d0c0b97c46f 100644 --- a/src/vs/vscode.proposed.d.ts +++ b/src/vs/vscode.proposed.d.ts @@ -377,59 +377,6 @@ declare module 'vscode' { //#endregion - //#region Joh: hierarchical document symbols, https://github.com/Microsoft/vscode/issues/34968 - - export class DocumentSymbol { - - /** - * The name of this symbol. - */ - name: string; - - /** - * More detail for this symbol, e.g the signature of a function. - */ - detail: string; - - /** - * The kind of this symbol. - */ - kind: SymbolKind; - - /** - * The range enclosing this symbol not including leading/trailing whitespace but everything else, e.g comments and code. - */ - range: Range; - - /** - * The range that should be selected and reveal when this symbol is being pciked, e.g the name of a function. - * Must be contained by the [`fullRange`](#DocumentSymbol.fullRange). - */ - selectionRange: Range; - - /** - * Children of this symbol, e.g. properties of a class. - */ - children: DocumentSymbol[]; - - /** - * Creates a new document symbol. - * - * @param name The name of the symbol. - * @param detail Details for the symbol. - * @param kind The kind of the symbol. - * @param range The full range of the symbol. - * @param selectionRange The range that should be reveal. - */ - constructor(name: string, detail: string, kind: SymbolKind, range: Range, selectionRange: Range); - } - - export interface DocumentSymbolProvider { - provideDocumentSymbols(document: TextDocument, token: CancellationToken): ProviderResult; - } - - //#endregion - //#region Joh -> exclusive document filters export interface DocumentFilter {