@@ -594,6 +594,7 @@ class CodeCompletionResult {
594594 unsigned SemanticContext : 3 ;
595595 unsigned NotRecommended : 1 ;
596596 unsigned NotRecReason : 3 ;
597+ unsigned IsSystem : 1 ;
597598
598599 // / The number of bytes to the left of the code completion point that
599600 // / should be erased first if this completion string is inserted in the
@@ -634,6 +635,7 @@ class CodeCompletionResult {
634635 assert (!isOperator () ||
635636 getOperatorKind () != CodeCompletionOperatorKind::None);
636637 AssociatedKind = 0 ;
638+ IsSystem = 0 ;
637639 }
638640
639641 // / Constructs a \c Keyword result.
@@ -651,6 +653,7 @@ class CodeCompletionResult {
651653 TypeDistance(TypeDistance) {
652654 assert (CompletionString);
653655 AssociatedKind = static_cast <unsigned >(Kind);
656+ IsSystem = 0 ;
654657 }
655658
656659 // / Constructs a \c Literal result.
@@ -667,6 +670,7 @@ class CodeCompletionResult {
667670 NumBytesToErase(NumBytesToErase), CompletionString(CompletionString),
668671 TypeDistance(TypeDistance) {
669672 AssociatedKind = static_cast <unsigned >(LiteralKind);
673+ IsSystem = 0 ;
670674 assert (CompletionString);
671675 }
672676
@@ -694,6 +698,7 @@ class CodeCompletionResult {
694698 TypeDistance(TypeDistance) {
695699 assert (AssociatedDecl && " should have a decl" );
696700 AssociatedKind = unsigned (getCodeCompletionDeclKind (AssociatedDecl));
701+ IsSystem = getDeclIsSystem (AssociatedDecl);
697702 assert (CompletionString);
698703 if (isOperator ())
699704 KnownOperatorKind =
@@ -706,8 +711,8 @@ class CodeCompletionResult {
706711 CodeCompletionResult (SemanticContextKind SemanticContext,
707712 unsigned NumBytesToErase,
708713 CodeCompletionString *CompletionString,
709- CodeCompletionDeclKind DeclKind, StringRef ModuleName ,
710- bool NotRecommended,
714+ CodeCompletionDeclKind DeclKind, bool IsSystem ,
715+ StringRef ModuleName, bool NotRecommended,
711716 CodeCompletionResult::NotRecommendedReason NotRecReason,
712717 StringRef BriefDocComment,
713718 ArrayRef<StringRef> AssociatedUSRs,
@@ -718,10 +723,10 @@ class CodeCompletionResult {
718723 KnownOperatorKind(unsigned (KnownOperatorKind)),
719724 SemanticContext(unsigned (SemanticContext)),
720725 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) {
725730 AssociatedKind = static_cast <unsigned >(DeclKind);
726731 assert (CompletionString);
727732 assert (!isOperator () ||
@@ -763,6 +768,10 @@ class CodeCompletionResult {
763768 return static_cast <CodeCompletionOperatorKind>(KnownOperatorKind);
764769 }
765770
771+ bool isSystem () const {
772+ return static_cast <bool >(IsSystem);
773+ }
774+
766775 ExpectedTypeRelation getExpectedTypeRelation () const {
767776 return static_cast <ExpectedTypeRelation>(TypeDistance);
768777 }
@@ -810,6 +819,7 @@ class CodeCompletionResult {
810819 getCodeCompletionOperatorKind (StringRef name);
811820 static CodeCompletionOperatorKind
812821 getCodeCompletionOperatorKind (CodeCompletionString *str);
822+ static bool getDeclIsSystem (const Decl *D);
813823};
814824
815825struct CodeCompletionResultSink {
0 commit comments