File tree 1 file changed +27
-0
lines changed
1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -872,6 +872,33 @@ TEST(CompletionTest, Documentation) {
872
872
Contains (AllOf (Named (" baz" ), Doc (" Multi-line\n block comment" ))));
873
873
}
874
874
875
+ TEST (CompletionTest, CommentsFromSystemHeaders) {
876
+ MockFSProvider FS;
877
+ MockCompilationDatabase CDB;
878
+ IgnoreDiagnostics DiagConsumer;
879
+
880
+ auto Opts = ClangdServer::optsForTest ();
881
+ Opts.BuildDynamicSymbolIndex = true ;
882
+
883
+ ClangdServer Server (CDB, FS, DiagConsumer, Opts);
884
+
885
+ FS.Files [testPath (" foo.h" )] = R"cpp(
886
+ #pragma GCC system_header
887
+
888
+ // This comment should be retained!
889
+ int foo();
890
+ )cpp" ;
891
+
892
+ auto Results = completions (Server,
893
+ R"cpp(
894
+ #include "foo.h"
895
+ int x = foo^
896
+ )cpp" );
897
+ EXPECT_THAT (
898
+ Results.Completions ,
899
+ Contains (AllOf (Named (" foo" ), Doc (" This comment should be retained!" ))));
900
+ }
901
+
875
902
TEST (CompletionTest, GlobalCompletionFiltering) {
876
903
877
904
Symbol Class = cls (" XYZ" );
You can’t perform that action at this time.
0 commit comments