Avoid ts changes (#2)

* Add ts server for inline hints

* Add some feature related configure

* Add more config

* Rename all options

* Support range

* Add new contribution point to allow specific context menu of inline hints.

* Fix filename

* Pass range into command

* Support trigger position and prefix/postfix

* Support hover message and contextValue

* Add event listener

* Avoid demo command

* Avoid ts changes
This commit is contained in:
Wenlu Wang
2021-01-18 17:24:23 +08:00
committed by GitHub
parent 9af036b827
commit fcc00b29f5
13 changed files with 294 additions and 25 deletions

View File

@@ -1787,9 +1787,18 @@ export class ExtHostLanguageFeatures implements extHostProtocol.ExtHostLanguageF
// --- inline hints
registerInlineHintsProvider(extension: IExtensionDescription, selector: vscode.DocumentSelector, provider: vscode.InlineHintsProvider): vscode.Disposable {
const eventHandle = typeof provider.onDidChangeInlineHints === 'function' ? this._nextHandle() : undefined;
const handle = this._addNewAdapter(new InlineHintsAdapter(this._documents, provider), extension);
this._proxy.$registerInlineHintsProvider(handle, this._transformDocumentSelector(selector));
return this._createDisposable(handle);
this._proxy.$registerInlineHintsProvider(handle, this._transformDocumentSelector(selector), eventHandle);
let result = this._createDisposable(handle);
if (eventHandle !== undefined) {
const subscription = provider.onDidChangeInlineHints!(_ => this._proxy.$emitInlineHintsEvent(eventHandle));
result = Disposable.from(result, subscription);
}
return result;
}
$provideInlineHints(handle: number, resource: UriComponents, range: IRange, token: CancellationToken): Promise<extHostProtocol.IInlineHintsDto | undefined> {