add range WIP

This commit is contained in:
kingwl
2020-12-25 01:37:42 +08:00
parent 2db89c75e6
commit 2697a42ee7
9 changed files with 59 additions and 39 deletions

View File

@@ -1070,9 +1070,9 @@ class InlineHintsAdapter {
private readonly _provider: vscode.InlineHintsProvider,
) { }
provideInlineHints(resource: URI, token: CancellationToken): Promise<extHostProtocol.IInlineHintsDto | undefined> {
provideInlineHints(resource: URI, range: Range, token: CancellationToken): Promise<extHostProtocol.IInlineHintsDto | undefined> {
const doc = this._documents.getDocument(resource);
return asPromise(() => this._provider.provideInlineHints(doc, token)).then(value => {
return asPromise(() => this._provider.provideInlineHints(doc, range, token)).then(value => {
if (value) {
const id = this._cache.add([value]);
return { hints: value.map(typeConvert.InlineHint.from), id };
@@ -1798,8 +1798,8 @@ export class ExtHostLanguageFeatures implements extHostProtocol.ExtHostLanguageF
// --- inline hints
$provideInlineHints(handle: number, resource: UriComponents, token: CancellationToken): Promise<extHostProtocol.IInlineHintsDto | undefined> {
return this._withAdapter(handle, InlineHintsAdapter, adapter => adapter.provideInlineHints(URI.revive(resource), token), undefined);
$provideInlineHints(handle: number, resource: UriComponents, range: Range, token: CancellationToken): Promise<extHostProtocol.IInlineHintsDto | undefined> {
return this._withAdapter(handle, InlineHintsAdapter, adapter => adapter.provideInlineHints(URI.revive(resource), range, token), undefined);
}
// --- links