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

Functions with multiple keywords display incorrect hover #48

Closed
gnikit opened this issue Feb 20, 2022 · 0 comments · Fixed by #49
Closed

Functions with multiple keywords display incorrect hover #48

gnikit opened this issue Feb 20, 2022 · 0 comments · Fixed by #49
Assignees
Labels
bug Something isn't working

Comments

@gnikit
Copy link
Member

gnikit commented Feb 20, 2022

If a function is defined with keyword1 type keyword2 function name() keyword1 will not be shown upon hover.

! function with type on definition, return and keywords
pure integer elemental function fun5(arg) result(retval)
    integer, intent(in) :: arg
end function fun5
@gnikit gnikit added the bug Something isn't working label Feb 20, 2022
@gnikit gnikit self-assigned this Feb 20, 2022
@gnikit gnikit linked a pull request Feb 21, 2022 that will close this issue
gnikit added a commit that referenced this issue Feb 21, 2022
It required major rewrite of the function definition parsing

Closes Functions with multiple keywords display incorrect hover #48

TODO:
1. Add tests about intrinsic functions
2. Add tests about functions returning arrays (this is actually a big deal)

2. touches on if hover should be displaying FORTRAN abiding code.
I am leaning towards yes, so displaying
```fortran
real dimension(10,10) function foo(arg) result(val)
  real, intent(in) :: arg
```
Does not seem the right thing for me to do. I think the hover request
should return instead
```fortran
real function foo(arg) result(val)
  real, intent(in) :: arg
  real, dimension(10,10) :: val
```

This way syntax highlighting in VSCode will not complain
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

Successfully merging a pull request may close this issue.

1 participant