Hello!
I have Modern Fortran and Fortran Intellisense installed and also Fortran language server installed, but when I open the .f90 file I get an error about Fortran Intellisense
Error launching fortls: Please check that all selected options are supported by your language server version.
I’ve never encountered anything like this before, but it came up a few days ago, and what I did was uninstall python2.7 and install anaconda3.
Can someone help me? Thank you so much
I am a student, and I have been learning fortran through vscode. Recently, this problem suddenly occurred, and when the statement is wrong, the error underline will not be displayed, and the error will only appear in the run. I checked that it was the problem of Modern Fortran, but I could not find the problem
It sounds like your fortls installation is somehow not valid. This can be a for any number of reasons:
Missing fortls
Very outdated version of fortls
Using an unsupported Python version (needs Python 3.7+)
Not having the root path where fortls is installed being part of your PYTHONPATH (can happen when you use a local virtual environment and don’t include the base dir e.g. $PWD/venv to your PYTHONPATH and hence fortls is not able to load it’s modules. FYI Any other Python package installed in that venv would fail similarly, not just fortls)
Thank you very much
I have read the reasons you have given.I have fortls, here are a few command lines from my terminal
C:\Users\dongsifan>fortls --version
2.13.0
C:\Users\dongsifan>python --version
Python 3.9.13
C:\Users\dongsifan>where fortls
D:\anaconda3\Scripts\fortls.exe
OS:windows
VS Code version:v1.72
Modern Fortran version:v3.2.0
The problem is Fortran Intellisense. It’s not compatible with Modern Fortran (it’s a dead extension). You should uninstall it from your system. Same as with fprettify. I am surprised you are not getting pop up errors asking you to uninstall.
You only need Modern Fortran. If you want to try the latest features I would install the prerelease
Thank you!
I have unloaded fortran Intellisense and fprettify.
I installed fprettify because modern fortran can’t format code for me and it can’t report an error problem, it only reports an error at compile time.
Now my fortran extensions are only fortran and Modern Fortran.What do I need to do?
You shouldn’t need to do anything. Modem Fortran does support a Language server, substantially more functional than Fortran Intellisense and formatters, hence why there is no need for the deprecated extensions.
You shouldn’t have fortran either, just Modern Fortran. These extensions were meant to do the same thing but fortan stopped receiving updates back in 2017, while we kept up to date.
Modern fortran is great, but it hasn’t been helping me with errors and auto-formatting code since a few days ago.
When I Alt+Shift+F,It comes:
There is no formatter for ‘fortran-modern’ files installed
I suggest you have a read at the Documentation for the extension. Settings do not come under the “modern-fortran” tag.
As I mentioned above, the functionality is there, it is tested and does work. I should know given I wrote all of these programs, so please read the docs and adjust your setup accordingly.
Modern Fortran WILL NOT WORK with any of the other 3 extensions you had installed alongside and it will fail quite visibly throwing pop up errors asking you to disable/uninstall the other extensions. I think that is a pretty clear indicator as to why it hasn’t been working.