Skip to content

suggested fix for span assignment related to forward declarations #100

@jmkinzer

Description

@jmkinzer

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    PR WelcomeExtra attention is neededenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions