Open rwirth opened 3 years ago
BTW this has now been fixed in fortls
and will soon be released for download with PyPi in version 2.0.0
Actually @rwirth , this is not entirely fixed. If the variable definition spans multiple lines and there are preprocessor directives inside it, the preprocessor directives are now ignored. The reason why I chose to do that is because currently we would have to create a second preprocessor parser to evaluate #if..
conditionals whenever we "get a line" inside the existing preprocessor parser.
So instead of doing that, I will at some point sit down and implement the preprocessor similarly to the rest of the Fortran objects.
you can find the solution in v2.0.0 of fortls
e.g. pip install fortls --upgrade
My project contains a lot of declarations like this:
The variables
var1
andvar2
do not get recognized by fortls and I do not get a hover. The debug log shows fortls returning null results:Preprocessing is activated for
.f90
files.I have temporarily fixed this by replacing the preprocessor directives with a string of spaces of equal length when performing the
output_file.append
inpreprocess_file
. This seems to work but I do not know if it breaks something else.