@@ -132,6 +132,14 @@ class CodeCompletionStringChunk {
132
132
Equal,
133
133
Whitespace,
134
134
135
+ // / The first chunk of a whole generic parameter clause.
136
+ // / E.g '<T, C: Collection>'
137
+ GenericParameterClauseBegin,
138
+
139
+ // / The first chunk of a generic quirement clause.
140
+ // / E.g. 'where T: Collection, T.Element == Int'
141
+ GenericRequirementClauseBegin,
142
+
135
143
// / The first chunk of a substring that describes the parameter for a
136
144
// / generic type.
137
145
GenericParameterBegin,
@@ -194,6 +202,30 @@ class CodeCompletionStringChunk {
194
202
// / desired.
195
203
OptionalMethodCallTail,
196
204
205
+ // / The first chunk of a substring that describes the single parameter
206
+ // / declaration for a parameter clause.
207
+ ParameterDeclBegin,
208
+
209
+ ParameterDeclExternalName,
210
+
211
+ ParameterDeclLocalName,
212
+
213
+ ParameterDeclColon,
214
+
215
+ ParameterDeclTypeBegin,
216
+
217
+ // / Default argument clause for parameter declarations.
218
+ DefaultArgumentClauseBegin,
219
+
220
+ // / First chunk for effect specifiers. i.e. 'async' and 'throws'.
221
+ EffectsSpecifierClauseBegin,
222
+
223
+ // / First chunk for result type clause i.e. ' -> ResultTy' or ': ResultTy'.
224
+ DeclResultTypeClauseBegin,
225
+
226
+ // / First chunk for attribute and modifier list i.e. 'override public'
227
+ AttributeAndModifierListBegin,
228
+
197
229
// / Specifies the type of the whole entity that is returned in this code
198
230
// / completion result. For example, for variable references it is the
199
231
// / variable type, for function calls it is the return type.
@@ -219,7 +251,15 @@ class CodeCompletionStringChunk {
219
251
Kind == ChunkKind::GenericParameterBegin ||
220
252
Kind == ChunkKind::OptionalBegin ||
221
253
Kind == ChunkKind::CallArgumentTypeBegin ||
222
- Kind == ChunkKind::TypeAnnotationBegin;
254
+ Kind == ChunkKind::TypeAnnotationBegin ||
255
+ Kind == ChunkKind::ParameterDeclBegin ||
256
+ Kind == ChunkKind::ParameterDeclTypeBegin ||
257
+ Kind == ChunkKind::DefaultArgumentClauseBegin ||
258
+ Kind == ChunkKind::GenericParameterClauseBegin ||
259
+ Kind == ChunkKind::EffectsSpecifierClauseBegin ||
260
+ Kind == ChunkKind::DeclResultTypeClauseBegin ||
261
+ Kind == ChunkKind::GenericRequirementClauseBegin ||
262
+ Kind == ChunkKind::AttributeAndModifierListBegin;
223
263
}
224
264
225
265
static bool chunkHasText (ChunkKind Kind) {
@@ -249,11 +289,14 @@ class CodeCompletionStringChunk {
249
289
Kind == ChunkKind::CallArgumentName ||
250
290
Kind == ChunkKind::CallArgumentInternalName ||
251
291
Kind == ChunkKind::CallArgumentColon ||
252
- Kind == ChunkKind::DeclAttrParamColon ||
253
- Kind == ChunkKind::DeclAttrParamKeyword ||
254
292
Kind == ChunkKind::CallArgumentType ||
255
293
Kind == ChunkKind::CallArgumentClosureType ||
256
294
Kind == ChunkKind::CallArgumentClosureExpr ||
295
+ Kind == ChunkKind::ParameterDeclExternalName ||
296
+ Kind == ChunkKind::ParameterDeclLocalName ||
297
+ Kind == ChunkKind::ParameterDeclColon ||
298
+ Kind == ChunkKind::DeclAttrParamColon ||
299
+ Kind == ChunkKind::DeclAttrParamKeyword ||
257
300
Kind == ChunkKind::GenericParameterName ||
258
301
Kind == ChunkKind::DynamicLookupMethodCallTail ||
259
302
Kind == ChunkKind::OptionalMethodCallTail ||
@@ -1053,17 +1096,20 @@ class PrintingCodeCompletionConsumer
1053
1096
llvm::raw_ostream &OS;
1054
1097
bool IncludeKeywords;
1055
1098
bool IncludeComments;
1099
+ bool IncludeSourceText;
1056
1100
bool PrintAnnotatedDescription;
1057
1101
bool RequiresSourceFileInfo = false ;
1058
1102
1059
1103
public:
1060
1104
PrintingCodeCompletionConsumer (llvm::raw_ostream &OS,
1061
1105
bool IncludeKeywords = true ,
1062
1106
bool IncludeComments = true ,
1107
+ bool IncludeSourceText = false ,
1063
1108
bool PrintAnnotatedDescription = false )
1064
1109
: OS(OS),
1065
1110
IncludeKeywords (IncludeKeywords),
1066
1111
IncludeComments(IncludeComments),
1112
+ IncludeSourceText(IncludeSourceText),
1067
1113
PrintAnnotatedDescription(PrintAnnotatedDescription) {}
1068
1114
1069
1115
void handleResults (CodeCompletionContext &context) override ;
0 commit comments