Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

suggested fix for span assignment related to forward declarations #100

Open
jmkinzer opened this issue May 19, 2024 · 1 comment
Open

suggested fix for span assignment related to forward declarations #100

jmkinzer opened this issue May 19, 2024 · 1 comment
Labels
enhancement New feature or request PR Welcome Extra attention is needed

Comments

@jmkinzer
Copy link

Hi,

There is an issue with how CppElement.Span is assigned in the case of headers containing forward declarations. The problem is that (in at least in some situations) the span will point to the forward declaration and not the real definition. The issue I believe lies here:

bool isForwardDeclaration = (element is CppClass || element is CppEnum) && !cursor.IsDefinition;

Where cursor.IsDefinition does not always yield the result we want. I was able to get the correct behavior using this instead:

image

@xoofx xoofx added enhancement New feature or request PR Welcome Extra attention is needed labels May 20, 2024
@xoofx
Copy link
Owner

xoofx commented May 20, 2024

Good to know, please make a PR if you want, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request PR Welcome Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants