Skip to content

Conversation

FederAndInk
Copy link
Contributor

@FederAndInk FederAndInk commented Jul 2, 2020

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

I also refactored a little by removing void* and replacing it with if constexpr see the first commit if it suits your requirements.

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

@FederAndInk FederAndInk force-pushed the fix/document_symbol branch from e54c4be to 7f438dc Compare July 2, 2020 21:01
@FederAndInk
Copy link
Contributor Author

FederAndInk commented Jul 3, 2020

Ok, static member variable aren't collected in collectRecordMembers because rd->fields() gives non-static data members only. Thus they aren't put in type.def.vars. at src/indexer.cc:673

Also, another bug I just discovered, I haven't looked up in details:

  • inline namespace

@FederAndInk
Copy link
Contributor Author

static member variable fixed:
Before:
Screenshot_20200704_130027
After:
Screenshot_20200704_130045

@FederAndInk FederAndInk force-pushed the fix/document_symbol branch from 6510ae9 to 7f1fc10 Compare July 5, 2020 10:55
@MaskRay MaskRay force-pushed the master branch 2 times, most recently from 7818055 to 99f0b40 Compare July 5, 2020 22:12
@MaskRay MaskRay force-pushed the master branch 4 times, most recently from a33231a to cb08df4 Compare July 20, 2020 00:03
int16_t short_name_size = 0;
SymbolKind kind = SymbolKind::Unknown;
SymbolKind parent_kind = SymbolKind::Unknown;
SymbolIdx parent = {0, Kind::Invalid};
Copy link
Owner

Choose a reason for hiding this comment

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

Will this increase memory usage?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, certainly, I haven't done measures. But I am working on another idea which doesn't introduce new things to the index and seems simpler and cleaner.

@MaskRay
Copy link
Owner

MaskRay commented May 9, 2021

Thanks for this patch and the alternative:) Merged the alternative

@MaskRay MaskRay closed this 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.

2 participants