mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-26 11:38:51 +01:00
Align ISuggestSupport further with ext host API
This commit is contained in:
@@ -475,7 +475,13 @@ interface ISuggestion2 extends modes.ISuggestion {
|
||||
|
||||
class SuggestAdapter implements modes.ISuggestSupport {
|
||||
|
||||
public triggerCharacters: string[] = [];
|
||||
public get triggerCharacters(): string[] {
|
||||
throw new Error('illegal state');
|
||||
}
|
||||
|
||||
public get shouldAutotriggerSuggest(): boolean {
|
||||
throw new Error('illegal state');
|
||||
}
|
||||
|
||||
private _documents: ExtHostModelService;
|
||||
private _provider: vscode.CompletionItemProvider;
|
||||
@@ -575,10 +581,6 @@ class SuggestAdapter implements modes.ISuggestSupport {
|
||||
return TypeConverters.Suggest.from(resolvedItem || item);
|
||||
});
|
||||
}
|
||||
|
||||
shouldAutotriggerSuggest(context: modes.ILineContext, offset: number, triggeredByCharacter: string): boolean {
|
||||
throw new Error('illegal state');
|
||||
}
|
||||
}
|
||||
|
||||
class SignatureHelpAdapter {
|
||||
@@ -1001,14 +1003,12 @@ export class MainThreadLanguageFeatures {
|
||||
$registerSuggestSupport(handle: number, selector: vscode.DocumentSelector, triggerCharacters: string[]): TPromise<any> {
|
||||
this._registrations[handle] = modes.SuggestRegistry.register(selector, <modes.ISuggestSupport>{
|
||||
triggerCharacters: triggerCharacters,
|
||||
shouldAutotriggerSuggest: true,
|
||||
suggest: (resource: URI, position: IPosition, triggerCharacter?: string): TPromise<modes.ISuggestResult[]> => {
|
||||
return this._proxy.$suggest(handle, resource, position);
|
||||
},
|
||||
getSuggestionDetails: (resource: URI, position: IPosition, suggestion: modes.ISuggestion): TPromise<modes.ISuggestion> => {
|
||||
return this._proxy.$getSuggestionDetails(handle, resource, position, suggestion);
|
||||
},
|
||||
shouldAutotriggerSuggest(): boolean {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
return undefined;
|
||||
|
||||
Reference in New Issue
Block a user