ui: precollapse files in code view
This change shows the files in the code view minimized, if more than 5. This greatly improves performance, because code and annotations won't get loaded until needed. Files including declarations or definitions of the active symbol are still expanded. The number of references in each file is now shown in it's title bar. Clicking the title bar allows for expanding and collapsing as well now.
This commit is contained in:
@@ -25,6 +25,24 @@ size_t TokenLocationFile::getTokenLocationLineCount() const
|
||||
return m_lines.size();
|
||||
}
|
||||
|
||||
size_t TokenLocationFile::getUnscopedStartTokenLocationCount() const
|
||||
{
|
||||
size_t count = 0;
|
||||
for (const TokenLocationLinePairType& line : m_lines)
|
||||
{
|
||||
line.second->forEachStartTokenLocation(
|
||||
[&count](TokenLocation* location)
|
||||
{
|
||||
if (!location->isScopeTokenLocation())
|
||||
{
|
||||
count++;
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
const FilePath& TokenLocationFile::getFilePath() const
|
||||
{
|
||||
return m_filePath;
|
||||
|
||||
Reference in New Issue
Block a user