@@ -2047,14 +2047,14 @@ class SKEditorConsumer : public EditorConsumer {
2047
2047
2048
2048
bool syntaxMapEnabled () override { return Opts.EnableSyntaxMap ; }
2049
2049
2050
- bool handleSyntaxMap (unsigned Offset, unsigned Length, UIdent Kind) override ;
2050
+ void handleSyntaxMap (unsigned Offset, unsigned Length, UIdent Kind) override ;
2051
2051
2052
- bool handleSemanticAnnotation (unsigned Offset, unsigned Length, UIdent Kind,
2052
+ void handleSemanticAnnotation (unsigned Offset, unsigned Length, UIdent Kind,
2053
2053
bool isSystem) override ;
2054
2054
2055
2055
bool documentStructureEnabled () override { return Opts.EnableStructure ; }
2056
2056
2057
- bool beginDocumentSubStructure (unsigned Offset, unsigned Length, UIdent Kind,
2057
+ void beginDocumentSubStructure (unsigned Offset, unsigned Length, UIdent Kind,
2058
2058
UIdent AccessLevel,
2059
2059
UIdent SetterAccessLevel,
2060
2060
unsigned NameOffset,
@@ -2070,30 +2070,29 @@ class SKEditorConsumer : public EditorConsumer {
2070
2070
ArrayRef<StringRef> InheritedTypes,
2071
2071
ArrayRef<std::tuple<UIdent, unsigned , unsigned >> Attrs) override ;
2072
2072
2073
- bool endDocumentSubStructure () override ;
2073
+ void endDocumentSubStructure () override ;
2074
2074
2075
- bool handleDocumentSubStructureElement (UIdent Kind,
2076
- unsigned Offset,
2075
+ void handleDocumentSubStructureElement (UIdent Kind, unsigned Offset,
2077
2076
unsigned Length) override ;
2078
2077
2079
- bool recordAffectedRange (unsigned Offset, unsigned Length) override ;
2078
+ void recordAffectedRange (unsigned Offset, unsigned Length) override ;
2080
2079
2081
- bool recordAffectedLineRange (unsigned Line, unsigned Length) override ;
2080
+ void recordAffectedLineRange (unsigned Line, unsigned Length) override ;
2082
2081
2083
- bool recordFormattedText (StringRef Text) override ;
2082
+ void recordFormattedText (StringRef Text) override ;
2084
2083
2085
- bool setDiagnosticStage (UIdent DiagStage) override ;
2086
- bool handleDiagnostic (const DiagnosticEntryInfo &Info,
2084
+ void setDiagnosticStage (UIdent DiagStage) override ;
2085
+ void handleDiagnostic (const DiagnosticEntryInfo &Info,
2087
2086
UIdent DiagStage) override ;
2088
2087
2089
- bool handleSourceText (StringRef Text) override ;
2088
+ void handleSourceText (StringRef Text) override ;
2090
2089
2091
- bool handleSyntaxTree (const swift::syntax::SourceFileSyntax &SyntaxTree,
2090
+ void handleSyntaxTree (const swift::syntax::SourceFileSyntax &SyntaxTree,
2092
2091
std::unordered_set<unsigned > ReusedNodeIds) override ;
2093
2092
2094
2093
bool syntaxReuseInfoEnabled () override { return Opts.EnableSyntaxReuseInfo ; }
2095
- bool handleSyntaxReuseRegions (
2096
- std::vector<SourceFileRange> ReuseRegions) override ;
2094
+ void
2095
+ handleSyntaxReuseRegions ( std::vector<SourceFileRange> ReuseRegions) override ;
2097
2096
2098
2097
SyntaxTreeTransferMode syntaxTreeTransferMode () override {
2099
2098
return Opts.SyntaxTransferMode ;
@@ -2268,24 +2267,22 @@ void SKEditorConsumer::handleRequestError(const char *Description) {
2268
2267
}
2269
2268
}
2270
2269
2271
- bool SKEditorConsumer::handleSyntaxMap (unsigned Offset, unsigned Length,
2270
+ void SKEditorConsumer::handleSyntaxMap (unsigned Offset, unsigned Length,
2272
2271
UIdent Kind) {
2273
2272
if (!Opts.EnableSyntaxMap )
2274
- return true ;
2273
+ return ;
2275
2274
2276
2275
SyntaxMap.add (Kind, Offset, Length, /* IsSystem=*/ false );
2277
- return true ;
2278
2276
}
2279
2277
2280
- bool SKEditorConsumer::handleSemanticAnnotation (unsigned Offset,
2281
- unsigned Length,
2282
- UIdent Kind, bool isSystem) {
2278
+ void SKEditorConsumer::handleSemanticAnnotation (unsigned Offset,
2279
+ unsigned Length, UIdent Kind,
2280
+ bool isSystem) {
2283
2281
assert (Kind.isValid ());
2284
2282
SemanticAnnotations.add (Kind, Offset, Length, isSystem);
2285
- return true ;
2286
2283
}
2287
2284
2288
- bool
2285
+ void
2289
2286
SKEditorConsumer::beginDocumentSubStructure (unsigned Offset,
2290
2287
unsigned Length, UIdent Kind,
2291
2288
UIdent AccessLevel,
@@ -2308,41 +2305,32 @@ SKEditorConsumer::beginDocumentSubStructure(unsigned Offset,
2308
2305
NameLength, BodyOffset, BodyLength, DocOffset, DocLength, DisplayName,
2309
2306
TypeName, RuntimeName, SelectorName, InheritedTypes, Attrs);
2310
2307
}
2311
- return true ;
2312
2308
}
2313
2309
2314
- bool SKEditorConsumer::endDocumentSubStructure () {
2310
+ void SKEditorConsumer::endDocumentSubStructure () {
2315
2311
if (Opts.EnableStructure )
2316
2312
DocStructure.endSubStructure ();
2317
- return true ;
2318
2313
}
2319
2314
2320
- bool SKEditorConsumer::handleDocumentSubStructureElement (UIdent Kind,
2315
+ void SKEditorConsumer::handleDocumentSubStructureElement (UIdent Kind,
2321
2316
unsigned Offset,
2322
2317
unsigned Length) {
2323
2318
if (Opts.EnableStructure )
2324
2319
DocStructure.addElement (Kind, Offset, Length);
2325
- return true ;
2326
2320
}
2327
2321
2328
- bool SKEditorConsumer::recordAffectedRange (unsigned Offset, unsigned Length) {
2322
+ void SKEditorConsumer::recordAffectedRange (unsigned Offset, unsigned Length) {
2329
2323
Dict.set (KeyOffset, Offset);
2330
2324
Dict.set (KeyLength, Length);
2331
-
2332
- return true ;
2333
2325
}
2334
2326
2335
- bool SKEditorConsumer::recordAffectedLineRange (unsigned Line, unsigned Length) {
2327
+ void SKEditorConsumer::recordAffectedLineRange (unsigned Line, unsigned Length) {
2336
2328
Dict.set (KeyLine, Line);
2337
2329
Dict.set (KeyLength, Length);
2338
-
2339
- return true ;
2340
2330
}
2341
2331
2342
- bool SKEditorConsumer::recordFormattedText (StringRef Text) {
2332
+ void SKEditorConsumer::recordFormattedText (StringRef Text) {
2343
2333
Dict.set (KeySourceText, Text);
2344
-
2345
- return true ;
2346
2334
}
2347
2335
2348
2336
static void fillDictionaryForDiagnosticInfoBase (
@@ -2409,15 +2397,14 @@ static void fillDictionaryForDiagnosticInfoBase(
2409
2397
}
2410
2398
}
2411
2399
2412
- bool SKEditorConsumer::setDiagnosticStage (UIdent DiagStage) {
2400
+ void SKEditorConsumer::setDiagnosticStage (UIdent DiagStage) {
2413
2401
Dict.set (KeyDiagnosticStage, DiagStage);
2414
- return true ;
2415
2402
}
2416
2403
2417
- bool SKEditorConsumer::handleDiagnostic (const DiagnosticEntryInfo &Info,
2404
+ void SKEditorConsumer::handleDiagnostic (const DiagnosticEntryInfo &Info,
2418
2405
UIdent DiagStage) {
2419
2406
if (!Opts.EnableDiagnostics )
2420
- return true ;
2407
+ return ;
2421
2408
2422
2409
ResponseBuilder::Array &Arr = Diags;
2423
2410
if (Arr.isNull ())
@@ -2426,19 +2413,17 @@ bool SKEditorConsumer::handleDiagnostic(const DiagnosticEntryInfo &Info,
2426
2413
auto Elem = Arr.appendDictionary ();
2427
2414
Elem.set (KeyDiagnosticStage, DiagStage);
2428
2415
fillDictionaryForDiagnosticInfo (Elem, Info);
2429
- return true ;
2430
2416
}
2431
2417
2432
- bool SKEditorConsumer::handleSourceText (StringRef Text) {
2418
+ void SKEditorConsumer::handleSourceText (StringRef Text) {
2433
2419
Dict.set (KeySourceText, Text);
2434
- return true ;
2435
2420
}
2436
2421
2437
- bool SKEditorConsumer::handleSyntaxTree (
2422
+ void SKEditorConsumer::handleSyntaxTree (
2438
2423
const swift::syntax::SourceFileSyntax &SyntaxTree,
2439
2424
std::unordered_set<unsigned > ReusedNodeIds) {
2440
2425
if (Opts.SyntaxTransferMode == SyntaxTreeTransferMode::Off)
2441
- return true ;
2426
+ return ;
2442
2427
2443
2428
std::string SyntaxTreeString;
2444
2429
{
@@ -2450,10 +2435,9 @@ bool SKEditorConsumer::handleSyntaxTree(
2450
2435
SyntaxTreeOutput << *SyntaxTree.getRaw ();
2451
2436
}
2452
2437
Dict.set (KeySerializedSyntaxTree, SyntaxTreeString);
2453
- return true ;
2454
2438
}
2455
2439
2456
- bool SKEditorConsumer::handleSyntaxReuseRegions (
2440
+ void SKEditorConsumer::handleSyntaxReuseRegions (
2457
2441
std::vector<SourceFileRange> ReuseRegions) {
2458
2442
if (Opts.EnableSyntaxReuseInfo ) {
2459
2443
auto Array = Dict.setArray (KeySyntaxReuseRegions);
@@ -2464,7 +2448,6 @@ bool SKEditorConsumer::handleSyntaxReuseRegions(
2464
2448
SubDict.set (KeyLength, Region.End - Region.Start );
2465
2449
}
2466
2450
}
2467
- return true ;
2468
2451
}
2469
2452
2470
2453
static sourcekitd_response_t
0 commit comments