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

Standardise function hover #47

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

Standardise function hover #47

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

Hover over functions can produce vastly different results depending on how the function is written.
Hover results will be different depending on whether the function type and the function result are present.
The output should be standardised regardless of how the function is written.

! simple function
function fun1(arg)
    integer, intent(in) :: arg
    integer :: fun1
end function fun1

! function with type on definition, implied result
integer function fun2(arg)
    integer, intent(in) :: arg
end function fun2

! function with return
function fun3(arg) result(retval)
    integer, intent(in) :: arg
    integer :: retval
end function fun3

! function with type on definition and return
integer function fun4(arg) result(retval)
    integer, intent(in) :: arg
end function fun4
@gnikit gnikit added the bug Something isn't working label Feb 20, 2022
@gnikit gnikit self-assigned this Feb 20, 2022
gnikit added a commit that referenced this issue Feb 21, 2022
Functions now all display the same signature:
`type` `keywords` `function` `name(args)` `result(val)`

- Submodule module procedure functions now display like so
- functions without an explicit type or result now display like so
- Nested functions i.e. using functions as args displays like so

Closes Add support for Fortran scope/block snippets #47

Adds a series of hover unittests.
Also renamed the result variables
@gnikit gnikit linked a pull request Feb 21, 2022 that will close this issue
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