@@ -594,6 +594,7 @@ class CodeCompletionResult {
594
594
unsigned SemanticContext : 3 ;
595
595
unsigned NotRecommended : 1 ;
596
596
unsigned NotRecReason : 3 ;
597
+ unsigned IsSystem : 1 ;
597
598
598
599
// / The number of bytes to the left of the code completion point that
599
600
// / should be erased first if this completion string is inserted in the
@@ -634,6 +635,7 @@ class CodeCompletionResult {
634
635
assert (!isOperator () ||
635
636
getOperatorKind () != CodeCompletionOperatorKind::None);
636
637
AssociatedKind = 0 ;
638
+ IsSystem = 0 ;
637
639
}
638
640
639
641
// / Constructs a \c Keyword result.
@@ -651,6 +653,7 @@ class CodeCompletionResult {
651
653
TypeDistance(TypeDistance) {
652
654
assert (CompletionString);
653
655
AssociatedKind = static_cast <unsigned >(Kind);
656
+ IsSystem = 0 ;
654
657
}
655
658
656
659
// / Constructs a \c Literal result.
@@ -667,6 +670,7 @@ class CodeCompletionResult {
667
670
NumBytesToErase(NumBytesToErase), CompletionString(CompletionString),
668
671
TypeDistance(TypeDistance) {
669
672
AssociatedKind = static_cast <unsigned >(LiteralKind);
673
+ IsSystem = 0 ;
670
674
assert (CompletionString);
671
675
}
672
676
@@ -694,6 +698,7 @@ class CodeCompletionResult {
694
698
TypeDistance(TypeDistance) {
695
699
assert (AssociatedDecl && " should have a decl" );
696
700
AssociatedKind = unsigned (getCodeCompletionDeclKind (AssociatedDecl));
701
+ IsSystem = getDeclIsSystem (AssociatedDecl);
697
702
assert (CompletionString);
698
703
if (isOperator ())
699
704
KnownOperatorKind =
@@ -706,8 +711,8 @@ class CodeCompletionResult {
706
711
CodeCompletionResult (SemanticContextKind SemanticContext,
707
712
unsigned NumBytesToErase,
708
713
CodeCompletionString *CompletionString,
709
- CodeCompletionDeclKind DeclKind, StringRef ModuleName ,
710
- bool NotRecommended,
714
+ CodeCompletionDeclKind DeclKind, bool IsSystem ,
715
+ StringRef ModuleName, bool NotRecommended,
711
716
CodeCompletionResult::NotRecommendedReason NotRecReason,
712
717
StringRef BriefDocComment,
713
718
ArrayRef<StringRef> AssociatedUSRs,
@@ -718,10 +723,10 @@ class CodeCompletionResult {
718
723
KnownOperatorKind(unsigned (KnownOperatorKind)),
719
724
SemanticContext(unsigned (SemanticContext)),
720
725
NotRecommended(NotRecommended), NotRecReason(NotRecReason),
721
- NumBytesToErase(NumBytesToErase ), CompletionString(CompletionString ),
722
- ModuleName(ModuleName ), BriefDocComment(BriefDocComment ),
723
- AssociatedUSRs(AssociatedUSRs ), DocWords(DocWords ),
724
- TypeDistance(TypeDistance) {
726
+ IsSystem(IsSystem ), NumBytesToErase(NumBytesToErase ),
727
+ CompletionString(CompletionString ), ModuleName(ModuleName ),
728
+ BriefDocComment(BriefDocComment ), AssociatedUSRs(AssociatedUSRs ),
729
+ DocWords(DocWords), TypeDistance(TypeDistance) {
725
730
AssociatedKind = static_cast <unsigned >(DeclKind);
726
731
assert (CompletionString);
727
732
assert (!isOperator () ||
@@ -763,6 +768,10 @@ class CodeCompletionResult {
763
768
return static_cast <CodeCompletionOperatorKind>(KnownOperatorKind);
764
769
}
765
770
771
+ bool isSystem () const {
772
+ return static_cast <bool >(IsSystem);
773
+ }
774
+
766
775
ExpectedTypeRelation getExpectedTypeRelation () const {
767
776
return static_cast <ExpectedTypeRelation>(TypeDistance);
768
777
}
@@ -810,6 +819,7 @@ class CodeCompletionResult {
810
819
getCodeCompletionOperatorKind (StringRef name);
811
820
static CodeCompletionOperatorKind
812
821
getCodeCompletionOperatorKind (CodeCompletionString *str);
822
+ static bool getDeclIsSystem (const Decl *D);
813
823
};
814
824
815
825
struct CodeCompletionResultSink {
0 commit comments