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

Fixes should be able to edit imports #220

Open
LiamPattinson opened this issue Dec 10, 2024 · 2 comments
Open

Fixes should be able to edit imports #220

LiamPattinson opened this issue Dec 10, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@LiamPattinson
Copy link
Collaborator

In order to make fixes like double precision -> real(real64), we'll need to be able to check that real64 has been imported from iso_fortran_env. If it hasn't then Fortitude should be able to add a new use statement.

Things to consider:

  • Imports should usually go at module scope, butthere are scenarios where it should be done within a function/submodule instead, e.g. interface
  • New use statements should be places somewhere logical around the existing ones, and we should avoid making new ones if it can be avoided. For example, if iso_fortran_env is already imported with only: real32, we should append to the end to create only: real32, real64 instead of adding a new use statement.
@LiamPattinson LiamPattinson added the enhancement New feature or request label Dec 10, 2024
@ZedThree
Copy link
Member

We might want an option to control whether we insert them at the module or procedure scope (defaulting to module).

@imciner2
Copy link
Contributor

It should also work with scopes not in a module. I recently was retrofitting a module call into a codebase where it was just bare subroutines, so in this case it would be best to put the use statement in the subroutine by default.

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

No branches or pull requests

3 participants