Skip to content

Doxygen style comments are sometimes picked up in the wrong place #237

Open
@plevold

Description

@plevold

Describe the bug
Due to the way fortls parses Doxygen style comments they could appear in unexpected places if a developer is not careful about using !> comments.

To Reproduce
In the following example:

subroutine sub_before
    integer :: i

    !> Trying to add a docstring to an expression
    i = 1
end subroutine


subroutine sub_no_doc
end subroutine

The comment !> Trying to add a docstring to an expression is added as a docstring to sub_no_doc.

Expected behavior
When building the AST, pendic_doc should probably be cleared when something other than subroutine / function / type / module appears.

See also #212 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinglsp/hoverIssues related with hovering requests

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions