From: Argyrios Kyrtzidis Date: Wed, 29 May 2013 18:50:15 +0000 (+0000) Subject: [libclang] For "@import .." code-completion results, associate a CXCursor_ModuleImpor... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fe038a32903c935e1bd9f2b62190c2c75a6754fe;p=clang [libclang] For "@import .." code-completion results, associate a CXCursor_ModuleImportDecl cursor instead of CXCursor_NotImplemented. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182871 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaCodeComplete.cpp b/lib/Sema/SemaCodeComplete.cpp index fd2ce1749f..b48836495f 100644 --- a/lib/Sema/SemaCodeComplete.cpp +++ b/lib/Sema/SemaCodeComplete.cpp @@ -3183,7 +3183,7 @@ void Sema::CodeCompleteModuleImport(SourceLocation ImportLoc, Builder.getAllocator().CopyString(Modules[I]->Name)); Results.AddResult(Result(Builder.TakeString(), CCP_Declaration, - CXCursor_NotImplemented, + CXCursor_ModuleImportDecl, Modules[I]->isAvailable() ? CXAvailability_Available : CXAvailability_NotAvailable)); @@ -3203,7 +3203,7 @@ void Sema::CodeCompleteModuleImport(SourceLocation ImportLoc, Builder.getAllocator().CopyString((*Sub)->Name)); Results.AddResult(Result(Builder.TakeString(), CCP_Declaration, - CXCursor_NotImplemented, + CXCursor_ModuleImportDecl, (*Sub)->isAvailable() ? CXAvailability_Available : CXAvailability_NotAvailable)); diff --git a/test/Index/complete-modules.m b/test/Index/complete-modules.m index d63c4b8956..175cf3db2c 100644 --- a/test/Index/complete-modules.m +++ b/test/Index/complete-modules.m @@ -5,12 +5,12 @@ // RUN: rm -rf %t // RUN: c-index-test -code-completion-at=%s:4:9 -fmodules-cache-path=%t -fmodules -F %S/Inputs/Frameworks -I %S/Inputs/Headers %s | FileCheck -check-prefix=CHECK-TOP-LEVEL %s -// CHECK-TOP-LEVEL: NotImplemented:{TypedText Framework} (50) -// CHECK-TOP-LEVEL: NotImplemented:{TypedText LibA} (50) -// CHECK-TOP-LEVEL: NotImplemented:{TypedText nested} (50) +// CHECK-TOP-LEVEL: ModuleImport:{TypedText Framework} (50) +// CHECK-TOP-LEVEL: ModuleImport:{TypedText LibA} (50) +// CHECK-TOP-LEVEL: ModuleImport:{TypedText nested} (50) // RUN: c-index-test -code-completion-at=%s:4:14 -fmodules-cache-path=%t -fmodules -F %S/Inputs/Frameworks -I %S/Inputs/Headers %s | FileCheck -check-prefix=CHECK-LIBA %s -// CHECK-LIBA: NotImplemented:{TypedText Extensions} (50) +// CHECK-LIBA: ModuleImport:{TypedText Extensions} (50) // RUN: c-index-test -code-completion-at=%s:4:1 -fmodules-cache-path=%t -fmodules -F %S/Inputs/Frameworks -I %S/Inputs/Headers %s | FileCheck -check-prefix=CHECK-TOP %s // CHECK-TOP: NotImplemented:{TypedText @import}{HorizontalSpace }{Placeholder module} (40)