Describe the bug
- Regex pattern issue
I was trying to use #include "petsc/finclude/petscvec.h", but fortls couldn't not find it despite the correct dir locations. After doing some pdb walkthrough, I found that, at regex_patterns.py:133, has a "missing" slash. With the above line, the output was "petsc, when it should've been "petsc/finclude/petscvec.h"`.
I was able to get around this issue by adding a slash in the regex patter, via
[ ]*#[ ]*include[ ]*([\"\w\./]*)
Now, if I paste the original regex pattern into a separate python file, say, myexample.py, the original pattern does spit out "petsc/finclude/petscvec.h", but in the actual fortls code, it does not. Also, if I try it on pythex.org, the original pattern only gives `"petsc".
I tried it on both Ubuntu 22.04.5 LTS + Intel(R) Xeon(R) Gold 5317 CPU @ 3.00GHz, Python 3.10.12, and
M1 Macbook Air, Pthon 3.10.14.
Anyway, I got my fortran + petsc to work via that fix - wasn't sure whether you do not want regex for slash or not.
Thanks.
To Reproduce
Try and reproduce the fortls error through the debug interface, for more see fortls --debug_help. Usually debug requests start like fortls --debug_filepath your_file.f90 --debug_rootpath . ....
Start with posting:
- a Minimal Working Example to demonstrate the bug
- the
fortls command to reproduce the issue, or your fortls
- the output of the
fortls command
- Any additional JSONRPC requests like the ones produced with
--debug_log
Alternatively, you can try and describe the steps that you followed to encounter the bug:
- Go to '...'
- Click on '....'
- Scroll down to '....'
- See error
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots & Animations
If applicable, add screenshots or GIF/MP4 animations to help explain your problem.
Setup information (please complete the following information):
- OS: [e.g. Linux, Mac]
- Python Version [e.g. 3.10]
- fortls Version [e.g. 2.3]
- Code editor used [e.g. VS Code, Vim]
- the Fortran extension for the code editor and its version [e.g. Modern Fortran v3.0.0] (if applicable)
Configuration information (please complete the following information):
- Your
.fortlsrc or .fortls.json or .fortls configuration file OR any other JSON config being used (if any)
- Any settings specified through your extension [e.g. for VS Code settings from
settings.json]
Additional context
Add any other context about the problem here.
Describe the bug
I was trying to use
#include "petsc/finclude/petscvec.h", but fortls couldn't not find it despite the correct dir locations. After doing some pdb walkthrough, I found that, atregex_patterns.py:133, has a "missing" slash. With the above line, the output was"petsc, when it should've been"petsc/finclude/petscvec.h"`.I was able to get around this issue by adding a slash in the regex patter, via
[ ]*#[ ]*include[ ]*([\"\w\./]*)Now, if I paste the original regex pattern into a separate python file, say,
myexample.py, the original pattern does spit out"petsc/finclude/petscvec.h", but in the actualfortlscode, it does not. Also, if I try it onpythex.org, the original pattern only gives `"petsc".I tried it on both Ubuntu 22.04.5 LTS + Intel(R) Xeon(R) Gold 5317 CPU @ 3.00GHz, Python 3.10.12, and
M1 Macbook Air, Pthon 3.10.14.
Anyway, I got my fortran + petsc to work via that fix - wasn't sure whether you do not want regex for slash or not.
Thanks.
To Reproduce
Try and reproduce the
fortlserror through the debug interface, for more seefortls --debug_help. Usually debug requests start likefortls --debug_filepath your_file.f90 --debug_rootpath . ....Start with posting:
fortlscommand to reproduce the issue, or yourfortlsfortlscommand--debug_logAlternatively, you can try and describe the steps that you followed to encounter the bug:
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots & Animations
If applicable, add screenshots or GIF/MP4 animations to help explain your problem.
Setup information (please complete the following information):
Configuration information (please complete the following information):
.fortlsrcor.fortls.jsonor.fortlsconfiguration file OR any other JSON config being used (if any)settings.json]Additional context
Add any other context about the problem here.