hansec / fortran-language-server

Fortran Language Server for the Language Server Protocol
MIT License
295 stars 57 forks source link

"Unexpected End of Scope at line X" error where it shouldn't be #136

Closed bcaddy closed 5 years ago

bcaddy commented 5 years ago

Several of the files in the project I recently inherited are showing "unexpected end of scope at line X" errors where there doesn't appear to be an issue. I've attached one of the offending files. Any ideas? rd_cont_orig.f90.txt

gnikit commented 5 years ago

I've had the same issue with our codes but I always assumed it originated from preprocessor directives and/or the use of PETSc and Zoltan libraries.

hansec commented 5 years ago

@bcaddy Thanks for the report! At least for the file you attached, it looks like this is fixed in master (1bdae4e). You seem to be seeing the same bug as issue #128. Can you test out the current master and see if it fixes all the issues in your other files too? If not, I hope to release a patch with these fixes in the next few days.

hansec commented 5 years ago

@GNikit Preprocessor directives can certainly be complicated to handle correctly. However, I think the current preprocessor implementation should prevent "end of scope" errors at least. If you have cases where this isn't true I would be happy to take a look and see if I can improve the functionality.

bcaddy commented 5 years ago

@hansec How do I install the latest master? I usually install with pip and pip's version is 1.10.1 which only appears to go to master (192a444)

hansec commented 5 years ago

@bcaddy I just pushed a patch that includes those fixes (1.10.2) so you should be able to just update normally. In the future if you want it is possible to use pip to install from a git repo.

bcaddy commented 5 years ago

That did it. Thanks!