Skip to content

Conversation

FederAndInk
Copy link
Contributor

This is an alternative to #660, I have redone all the algorithm for hierarchical document symbol, it is based on ranges of symbols and not on symbols and their children because some of them were missing and "duplicates" were removed (eg: namespace redefinition in the same file, or inline function defined after the class)

When we have members defined outside the class in a namespace in a separate file, the namespace doesn't have the members as children. The outline and breadcrumbs don't work correctly for them.
Before:
Screenshot_20200702_214411
After:
Screenshot_20200702_213950

There are other bugs with outline that I noticed which I am working on:

  • static member variable aren't in their class/struct
  • defined member functions after the class definition in the same file override the member function declaration
  • inline namespace

std::unordered_map<SymbolIdx, std::unique_ptr<DocumentSymbol>> sym2ds;
std::vector<std::pair<std::vector<const void *>, DocumentSymbol *>> funcs,
types;
std::vector<ExtentRef> syms;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We may want this to be a vector of pointer to take less memory 32B to 8B per element and then sort the pointers.

@FederAndInk FederAndInk changed the title Fix/document symbol range based Fix document symbol with a range based method (outline and breadcumbs) Jul 20, 2020
@FederAndInk
Copy link
Contributor Author

Is there someone who can review this?

@FederAndInk FederAndInk force-pushed the fix/document_symbol_range_based branch from ca7252c to 407f78e Compare April 1, 2021 14:23
eg:
int i, j, k;

outline before:
k
 j
  i
after:
i
j
k
@joelhock
Copy link

joelhock commented May 7, 2021

i can say this fixed the issue for me, so I'm in favor!

MaskRay pushed a commit that referenced this pull request May 9, 2021
MaskRay pushed a commit that referenced this pull request May 9, 2021
MaskRay pushed a commit that referenced this pull request May 9, 2021
MaskRay pushed a commit that referenced this pull request May 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants