Open
Description
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)