forked from qt-creator/qt-creator
ClangCodeModel: Support access type categorization
... with "Find Usages", as we do in the built-in code model.
Note 1: This is very slow, so it's for now only enabled if the
search results come from a small number of files.
Possible ways of speeding up the operation
to be investigated.
Note 2: All test cases from the old code model also pass here,
but checking with non-trivial real-world projects
shows a lot of mis-categorizations.
Well will fix them one by one.
Note 3: This functionality requires clangd >= 13.
Change-Id: Ib3500b52996dbbf9d7d9712d729179bcbd3262fc
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -97,11 +97,9 @@ void RefactoringEngine::findUsages(const CppTools::CursorInEditor &cursor,
|
||||
->findUsages(cursor, std::move(callback));
|
||||
return;
|
||||
}
|
||||
// TODO: We want to keep our "access type info" feature.
|
||||
// Check whether we can support it using clang 12's textDocument/ast request
|
||||
if (!client->documentOpen(cursor.textDocument()))
|
||||
client->openDocument(cursor.textDocument()); // TODO: Just a workaround
|
||||
client->symbolSupport().findUsages(cursor.textDocument(), cursor.cursor());
|
||||
client->findUsages(cursor.textDocument(), cursor.cursor());
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
Reference in New Issue
Block a user