Skip to content

Commit a2f6ec6

Browse files
committed
jsdoc for microsoft#67872
1 parent 52a923c commit a2f6ec6

1 file changed

Lines changed: 41 additions & 4 deletions

File tree

src/vs/vscode.proposed.d.ts

Lines changed: 41 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,24 +84,61 @@ declare module 'vscode' {
8484

8585
//#region Joh - selection range provider
8686

87+
/**
88+
* A selection range represents a part of a selection hierarchy. A selection range
89+
* may have a parent selection range that contains it.
90+
*/
8791
export class SelectionRange {
92+
93+
/**
94+
* The [range](#Range) of this selection range.
95+
*/
8896
range: Range;
97+
98+
/**
99+
* The parent selection range containing this range.
100+
*/
89101
parent?: SelectionRange;
102+
103+
/**
104+
* Creates a new selection range.
105+
*
106+
* @param range The range of the selection range.
107+
* @param parent The parent of the selection range.
108+
*/
90109
constructor(range: Range, parent?: SelectionRange);
91110
}
92111

93112
export interface SelectionRangeProvider {
94113
/**
95-
* Provide selection ranges for the given positions. Selection ranges should be computed individually and
96-
* independend for each postion. The editor will merge and deduplicate ranges but providers must return sequences
97-
* of ranges (per position) where a range must [contain](#Range.contains) and subsequent ranges.
114+
* Provide selection ranges for the given positions.
115+
*
116+
* Selection ranges should be computed individually and independend for each postion. The editor will merge
117+
* and deduplicate ranges but providers must return hierarchies of selection ranges so that a range
118+
* is [contained](#Range.contains) by its parent.
98119
*
99-
* todo@joh
120+
* @param document The document in which the command was invoked.
121+
* @param positions The positions at which the command was invoked.
122+
* @param token A cancellation token.
123+
* @return Selection ranges or a thenable that resolves to such. The lack of a result can be
124+
* signaled by returning `undefined` or `null`.
100125
*/
101126
provideSelectionRanges(document: TextDocument, positions: Position[], token: CancellationToken): ProviderResult<SelectionRange[]>;
102127
}
103128

104129
export namespace languages {
130+
131+
/**
132+
* Register a selection range provider.
133+
*
134+
* Multiple providers can be registered for a language. In that case providers are asked in
135+
* parallel and the results are merged. A failing provider (rejected promise or exception) will
136+
* not cause a failure of the whole operation.
137+
*
138+
* @param selector A selector that defines the documents this provider is applicable to.
139+
* @param provider A selection range provider.
140+
* @return A [disposable](#Disposable) that unregisters this provider when being disposed.
141+
*/
105142
export function registerSelectionRangeProvider(selector: DocumentSelector, provider: SelectionRangeProvider): Disposable;
106143
}
107144

0 commit comments

Comments
 (0)