data: parsing file dependencies
This change adds the node NODE_FILE to the graph and the edge EDGE_INCLUDE, which determine the dependencies between files by parsing the include preprocessor directive. File nodes can be searched and displayed in the GraphView as file dependency graph. The filter "file" allows for selecting all files. The file depency information is used on project refresh do determine which files need to get reparsed.
This commit is contained in:
@@ -1709,6 +1709,10 @@ public:
|
||||
TS_ASSERT_EQUALS(client.calls.size(), 2);
|
||||
TS_ASSERT_EQUALS(client.usages.size(), 3);
|
||||
TS_ASSERT_EQUALS(client.typeUses.size(), 8);
|
||||
|
||||
TS_ASSERT_EQUALS(client.files.size(), 2);
|
||||
TS_ASSERT_EQUALS(client.includes.size(), 1);
|
||||
TS_ASSERT_EQUALS(client.includes[0], client.files[1] + " -> " + client.files[0]);
|
||||
}
|
||||
|
||||
void test_cxx_parser_catches_error()
|
||||
@@ -1954,6 +1958,19 @@ private:
|
||||
return 0;
|
||||
}
|
||||
|
||||
virtual Id onFileParsed(const std::string& filePath)
|
||||
{
|
||||
files.push_back(filePath);
|
||||
return 0;
|
||||
}
|
||||
|
||||
virtual Id onFileIncludeParsed(
|
||||
const ParseLocation& location, const std::string& filePath, const std::string& includedPath)
|
||||
{
|
||||
includes.push_back(filePath + " -> " + includedPath);
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::vector<std::string> errors;
|
||||
|
||||
std::vector<std::string> typedefs;
|
||||
@@ -1977,6 +1994,9 @@ private:
|
||||
std::vector<std::string> templateDefaultArgumentTypes;
|
||||
std::vector<std::string> templateSpecializations;
|
||||
|
||||
std::vector<std::string> files;
|
||||
std::vector<std::string> includes;
|
||||
|
||||
private:
|
||||
void addTypeUse(const ParseTypeUsage& use)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user