-
-
Notifications
You must be signed in to change notification settings - Fork 52
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
I tried to create a macro ok() that checks if an error code ie is set and returns from the subroutine.
This was intended to reduce the amount of boiler plate required to do error checking.
However this breaks fortls.
- Fortls can not find the module where the macro is used.
- Fortls can not autocomplete / hover / go-to-def inside the module.
- Fortls can not autocomplete / hover / go-to-def when using types / methods outside of the module.
To Reproduce
Not sure if this will reproduce the bug on your machine; but this is a minimal code to reproduce the error.
Create file main.F90
program X
use A
call B()
end programCreate file a.F90
! BUG: Using this macro causes fortls to break down
#define ok() if(ie/=0) then; return; end if;
! Suprisingly this works well.
! #define ok()
module A
implicit none
contains
subroutine B
integer :: ie
ie = 1
ok()
end subroutine
end moduleExpected behavior
Why do macros break fortls?
- If a macro exists fortls should ignore it.
- Or allow the user to ignore them through configuration.
Screenshots & Animations
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
