From 4b58bb679c874d7343f2ca202b6a85f830eed85b Mon Sep 17 00:00:00 2001 From: Eberhard Graether Date: Wed, 31 Jul 2019 21:37:53 +0200 Subject: [PATCH] data: Fixed files within precompiled header have no syntax highlighting - removed working_copy from project setup tests --- src/lib_cxx/data/parser/cxx/CxxAstVisitor.cpp | 2 ++ .../cxx_cdb_pch/working_copy/asdf.srctrlprj | 26 ------------------- .../working_copy/compile_commands.json | 7 ----- .../working_copy/src/include/Bar.h | 17 ------------ .../working_copy/src/include/Foo.h | 14 ---------- .../working_copy/src/include/FooBar.h | 8 ------ .../cxx_cdb_pch/working_copy/src/main.cpp | 8 ------ .../cxx_cdb_pch/working_copy/src/pch.hpp | 9 ------- 8 files changed, 2 insertions(+), 89 deletions(-) delete mode 100644 testing/project_setup/cxx_cdb_pch/working_copy/asdf.srctrlprj delete mode 100644 testing/project_setup/cxx_cdb_pch/working_copy/compile_commands.json delete mode 100644 testing/project_setup/cxx_cdb_pch/working_copy/src/include/Bar.h delete mode 100644 testing/project_setup/cxx_cdb_pch/working_copy/src/include/Foo.h delete mode 100644 testing/project_setup/cxx_cdb_pch/working_copy/src/include/FooBar.h delete mode 100644 testing/project_setup/cxx_cdb_pch/working_copy/src/main.cpp delete mode 100644 testing/project_setup/cxx_cdb_pch/working_copy/src/pch.hpp diff --git a/src/lib_cxx/data/parser/cxx/CxxAstVisitor.cpp b/src/lib_cxx/data/parser/cxx/CxxAstVisitor.cpp index 660a8908..5fe7290a 100644 --- a/src/lib_cxx/data/parser/cxx/CxxAstVisitor.cpp +++ b/src/lib_cxx/data/parser/cxx/CxxAstVisitor.cpp @@ -67,6 +67,7 @@ void CxxAstVisitor::indexDecl(clang::Decl* d) { LOG_INFO("starting AST traversal"); + // record files not handled in preprocessor callbacks, e.g. files within precompiled header clang::SourceManager& sourceManager = m_astContext->getSourceManager(); for (auto it = sourceManager.fileinfo_begin(); it != sourceManager.fileinfo_end(); it++) { @@ -79,6 +80,7 @@ void CxxAstVisitor::indexDecl(clang::Decl* d) const FilePath filePath = m_canonicalFilePathCache->getCanonicalFilePath(fileEntry); const bool pathIsProjectFile = m_canonicalFilePathCache->isProjectFile(fileId, sourceManager); const Id symbolId = m_client->recordFile(filePath, pathIsProjectFile); + m_client->recordFileLanguage(symbolId, L"cpp"); m_canonicalFilePathCache->addFileSymbolId(fileId, filePath, symbolId); } } diff --git a/testing/project_setup/cxx_cdb_pch/working_copy/asdf.srctrlprj b/testing/project_setup/cxx_cdb_pch/working_copy/asdf.srctrlprj deleted file mode 100644 index 90eb2e36..00000000 --- a/testing/project_setup/cxx_cdb_pch/working_copy/asdf.srctrlprj +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - compile_commands.json - - - -DCOMPILER_FLAG - - - src - - C/C++ from Compilation Database - - -DPCH_FLAG - 1 - 1 - - src/pch.hpp - enabled - C/C++ from Compilation Database - - - 8 - diff --git a/testing/project_setup/cxx_cdb_pch/working_copy/compile_commands.json b/testing/project_setup/cxx_cdb_pch/working_copy/compile_commands.json deleted file mode 100644 index aaa876cf..00000000 --- a/testing/project_setup/cxx_cdb_pch/working_copy/compile_commands.json +++ /dev/null @@ -1,7 +0,0 @@ -[ - { - "directory": "/Users/ebsi/Documents/Coati/testing/project_setup/cxx_cdb_pch/working_copy", - "command": "clang-tool -fms-extensions -fms-compatibility -fms-compatibility-version=19 -isystem \"/Users/ebsi/Documents/Coati/testing/project_setup/cxx_cdb_pch/working_copy/src/include\" -DCDB_FLAG -D _DEBUG -D _MT -D _DLL -D WIN32 -D _WINDOWS -D BUILD_TYPE=\"\" -D QT_WIDGETS_LIB -D QT_GUI_LIB -D QT_CORE_LIB -D QT_NETWORK_LIB -D QT_WINEXTRAS_LIB -D QT_SVG_LIB -D CMAKE_INTDIR=\"Debug\" -D _MBCS -std=c++14 \"/Users/ebsi/Documents/Coati/testing/project_setup/cxx_cdb_pch/working_copy/src/main.cpp\"", - "file": "/Users/ebsi/Documents/Coati/testing/project_setup/cxx_cdb_pch/working_copy/src/main.cpp" - } -] diff --git a/testing/project_setup/cxx_cdb_pch/working_copy/src/include/Bar.h b/testing/project_setup/cxx_cdb_pch/working_copy/src/include/Bar.h deleted file mode 100644 index 3b69a8bc..00000000 --- a/testing/project_setup/cxx_cdb_pch/working_copy/src/include/Bar.h +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef FOO_H -#define FOO_H - -#include "FooBar.h" - -#ifndef COMPILER_FLAG - #error "COMPILER_FLAG not defined" -#else - -class Bar : public FooBar -{ -}; - -#endif - - -#endif // FOO_H diff --git a/testing/project_setup/cxx_cdb_pch/working_copy/src/include/Foo.h b/testing/project_setup/cxx_cdb_pch/working_copy/src/include/Foo.h deleted file mode 100644 index e8d82cf0..00000000 --- a/testing/project_setup/cxx_cdb_pch/working_copy/src/include/Foo.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef BAR_H -#define BAR_H - -#include "FooBar.h" - -#ifndef CDB_FLAG - #error "CDB_FLAG not defined" -#endif - -class Foo : public FooBar -{ -}; - -#endif // FOO_BAR_H diff --git a/testing/project_setup/cxx_cdb_pch/working_copy/src/include/FooBar.h b/testing/project_setup/cxx_cdb_pch/working_copy/src/include/FooBar.h deleted file mode 100644 index 0e9062d4..00000000 --- a/testing/project_setup/cxx_cdb_pch/working_copy/src/include/FooBar.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef FOO_BAR_H -#define FOO_BAR_H - -class FooBar -{ -}; - -#endif // FOO_BAR_H diff --git a/testing/project_setup/cxx_cdb_pch/working_copy/src/main.cpp b/testing/project_setup/cxx_cdb_pch/working_copy/src/main.cpp deleted file mode 100644 index d7e8211a..00000000 --- a/testing/project_setup/cxx_cdb_pch/working_copy/src/main.cpp +++ /dev/null @@ -1,8 +0,0 @@ -#include "pch.hpp" - -void test() -{ - Foo foo; - Bar bar; -} - diff --git a/testing/project_setup/cxx_cdb_pch/working_copy/src/pch.hpp b/testing/project_setup/cxx_cdb_pch/working_copy/src/pch.hpp deleted file mode 100644 index bee5a38a..00000000 --- a/testing/project_setup/cxx_cdb_pch/working_copy/src/pch.hpp +++ /dev/null @@ -1,9 +0,0 @@ - -#ifndef PCH_FLAG - #error "PCH_FLAG not defined" -#else - -#include "Foo.h" -#include "Bar.h" - -#endif