@@ -1024,17 +1024,25 @@ class SuggestAdapter {
1024
1024
}
1025
1025
}
1026
1026
1027
- class InlineCompletionAdapter {
1027
+ class InlineCompletionAdapterBase {
1028
+ public async provideInlineCompletions ( resource : URI , position : IPosition , context : languages . InlineCompletionContext , token : CancellationToken ) : Promise < extHostProtocol . IdentifiableInlineCompletions | undefined > {
1029
+ return undefined ;
1030
+ }
1031
+ }
1032
+
1033
+ class InlineCompletionAdapter extends InlineCompletionAdapterBase {
1028
1034
private readonly _cache = new Cache < vscode . InlineCompletionItem > ( 'InlineCompletionItem' ) ;
1029
1035
private readonly _disposables = new Map < number , DisposableStore > ( ) ;
1030
1036
1031
1037
constructor (
1032
1038
private readonly _documents : ExtHostDocuments ,
1033
1039
private readonly _provider : vscode . InlineCompletionItemProvider ,
1034
1040
private readonly _commands : CommandsConverter ,
1035
- ) { }
1041
+ ) {
1042
+ super ( ) ;
1043
+ }
1036
1044
1037
- public async provideInlineCompletions ( resource : URI , position : IPosition , context : languages . InlineCompletionContext , token : CancellationToken ) : Promise < extHostProtocol . IdentifiableInlineCompletions | undefined > {
1045
+ public override async provideInlineCompletions ( resource : URI , position : IPosition , context : languages . InlineCompletionContext , token : CancellationToken ) : Promise < extHostProtocol . IdentifiableInlineCompletions | undefined > {
1038
1046
const doc = this . _documents . getDocument ( resource ) ;
1039
1047
const pos = typeConvert . Position . to ( position ) ;
1040
1048
@@ -1113,7 +1121,7 @@ class InlineCompletionAdapter {
1113
1121
}
1114
1122
}
1115
1123
1116
- class InlineCompletionAdapterNew {
1124
+ class InlineCompletionAdapterNew extends InlineCompletionAdapterBase {
1117
1125
private readonly _cache = new Cache < vscode . InlineCompletionItemNew > ( 'InlineCompletionItemNew' ) ;
1118
1126
private readonly _disposables = new Map < number , DisposableStore > ( ) ;
1119
1127
@@ -1124,14 +1132,16 @@ class InlineCompletionAdapterNew {
1124
1132
private readonly _documents : ExtHostDocuments ,
1125
1133
private readonly _provider : vscode . InlineCompletionItemProviderNew ,
1126
1134
private readonly _commands : CommandsConverter ,
1127
- ) { }
1135
+ ) {
1136
+ super ( ) ;
1137
+ }
1128
1138
1129
1139
private readonly languageTriggerKindToVSCodeTriggerKind : Record < languages . InlineCompletionTriggerKind , vscode . InlineCompletionTriggerKindNew > = {
1130
1140
[ languages . InlineCompletionTriggerKind . Automatic ] : InlineCompletionTriggerKindNew . Automatic ,
1131
1141
[ languages . InlineCompletionTriggerKind . Explicit ] : InlineCompletionTriggerKindNew . Invoke ,
1132
1142
} ;
1133
1143
1134
- public async provideInlineCompletions ( resource : URI , position : IPosition , context : languages . InlineCompletionContext , token : CancellationToken ) : Promise < extHostProtocol . IdentifiableInlineCompletions | undefined > {
1144
+ public override async provideInlineCompletions ( resource : URI , position : IPosition , context : languages . InlineCompletionContext , token : CancellationToken ) : Promise < extHostProtocol . IdentifiableInlineCompletions | undefined > {
1135
1145
const doc = this . _documents . getDocument ( resource ) ;
1136
1146
const pos = typeConvert . Position . to ( position ) ;
1137
1147
@@ -2156,7 +2166,7 @@ export class ExtHostLanguageFeatures implements extHostProtocol.ExtHostLanguageF
2156
2166
}
2157
2167
2158
2168
$provideInlineCompletions ( handle : number , resource : UriComponents , position : IPosition , context : languages . InlineCompletionContext , token : CancellationToken ) : Promise < extHostProtocol . IdentifiableInlineCompletions | undefined > {
2159
- return this . _withAdapter ( handle , InlineCompletionAdapter , adapter => adapter . provideInlineCompletions ( URI . revive ( resource ) , position , context , token ) , undefined , token ) ;
2169
+ return this . _withAdapter ( handle , InlineCompletionAdapterBase , adapter => adapter . provideInlineCompletions ( URI . revive ( resource ) , position , context , token ) , undefined , token ) ;
2160
2170
}
2161
2171
2162
2172
$handleInlineCompletionDidShow ( handle : number , pid : number , idx : number ) : void {
0 commit comments