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

Parsing external functions #177

Open
thijssteel opened this issue Oct 5, 2020 · 2 comments
Open

Parsing external functions #177

thijssteel opened this issue Oct 5, 2020 · 2 comments

Comments

@thijssteel
Copy link

A bit of a continuation of my previous issue.

When working with legacy code (and sometimes even recent codes written by old school hardliners), its quite common to simply have a file for each subroutine and not work with modules. For as far as i can tell these kinds of links are ignored by the language server because no use statements are present (sorry if i'm wrong about that, my python knowledge isn't that great.).

The default behaviour for most libraries is that the name of the file is also the name of the subroutine. Would it be possible to search the source path when a function is defined as external? Or perhaps we could keep a list of all the subroutines residing outside a module?

@hansec
Copy link
Owner

hansec commented Oct 14, 2020

Thanks for the report. Although, I believe that the language server already handles this type of situation. Any functions/subroutines defined in files without modules should be automatically added to the "global" scope that is visible in every file, module, etc. Keep in mind all the source files must be visible to the language server either under the root path or via specifying specific directories. Do you have an example of a specific case where this is not happening?

@thijssteel
Copy link
Author

Hmm, it seems I was a bit confused.

The hover functionality seems to work with both global scope and modules. So I was indeed wrong.

However, it seems the error wiggles when subroutine arguments do not match don't show up with the vscode plugin.
When I use modules and the f90 extension, the modern fortran plugin in vscode does show error wiggles.

I'll investigate further.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants