Skip to content

Multiline function and subroutine hover displays duplicates #59

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

Closed
gnikit opened this issue Feb 25, 2022 · 4 comments
Closed

Multiline function and subroutine hover displays duplicates #59

gnikit opened this issue Feb 25, 2022 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@gnikit
Copy link
Member

gnikit commented Feb 25, 2022

If the argument list in a function or a subroutine spans multiple lines, hovering on an argument that is not on the scope start will show two signatures

MWE

   real function foo(val1, &
                     val2) &
                     result(val4)

      integer :: val1, val2
   end function foo

Screenshot from 2022-02-25 14-25-03

I think we should keep only the latter definition, which includes the variable name. Currently the default behaviour is to just show the type

@gnikit
Copy link
Member Author

gnikit commented Nov 1, 2022

I can't replicate this with the latest version

@gnikit gnikit closed this as completed Nov 1, 2022
@gnikit
Copy link
Member Author

gnikit commented Nov 1, 2022

Was somewhat resolved in commit a3dce8d although now hovering over multiline arguments does not yield the right result

@gnikit gnikit reopened this Nov 1, 2022
@gnikit
Copy link
Member Author

gnikit commented Nov 1, 2022

This is because when we have multilines in fortls (&) we advance the line number prior to the AST parsing by

ine_no += len(post_lines)

which registers the scope at the END of the multiline as opposed to the very top

@gnikit
Copy link
Member Author

gnikit commented Nov 1, 2022

With fix applied to PR #217 this can no longer be replicated so I will be closing.

@gnikit gnikit closed this as completed Nov 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant