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

Fortls can't read "use mod, only: procedure" if followed by a comment #450

Open
cWetaski opened this issue Dec 11, 2024 · 0 comments
Open
Labels
bug Something isn't working

Comments

@cWetaski
Copy link

cWetaski commented Dec 11, 2024

Describe the bug
A very minor bug, but a bug (I think) nonetheless. If I use a specific subroutine/function from a module, the linter can't find it if the name of the subroutine is followed by a comment. If I have multiple subroutines/functions after the only: statement, then only the last one will not be found by the linter (if it is followed by a comment).

To Reproduce

  1. Create a module with a subroutine.
  2. Create a second module which usees the subroutine from the first module
  3. Compare linting behavior with or without a comment of the use statement

Expected behavior
fortls should find useed procedures regardless of whether they are followed by a comment or not.

Screenshots & Animations
used_module.f90
Image

user_module.f90 attempted hover / peek with comment (does not work)
Image

user_module.f90 attempted hover without comment (works correctly)
Image

Setup information (please complete the following information):

  • OS: [Windows 11]
  • Python Version [3.12.7]
  • fortls Version [3.1.2]
  • Code editor used [VSCode]
  • the Fortran extension for the code editor and its version [Modern Fortran v3.2.0 (also checked with Modern Fortran prerelease v3.4.2024101621]
  • Compiler [gfortran 14.2.0]

Configuration information (please complete the following information):
relevant snippet from Workspace settings.json:

    "fortran.linter.modOutput": "${workspaceFolder}/.vscode/linter",
    "fortran.linter.includePaths": [
        "${workspaceFolder}/.vscode/linter"
    ],

Edit: Removed description of a "workaround" using a comma after the subroutine name since this is invalid syntax.

@cWetaski cWetaski added the bug Something isn't working label Dec 11, 2024
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