I am new in fortran and i’m trying to get Modern Fortran in VScode to work. Have issue with “Had trouble installing fortls, please install manually”. I guess I downloaded fortls ( and findent for sure). I put path from the console in Language Server Fortran Path fortls box, but it doesn’t gave any result. Still “Had trouble installing fortls, please install manually”. Am I something missing?
Hello everyone,
(I am not English speaking, so I really appologise for possible mistakes).
I’m totally new in Fortran and I try to find an explanation how to run Modern Fortran for VS code. Specifically, I found it, but didn’t understand at all. The main problem for me is the installation of fortls.
I have the following error: “Had trouble installing fortls, please install manually”. At first I saw information that I should specify the correct path, but then I figured out that before troubles with path I should install so called pip, shouldn’t I? If yes, how and where? I tried to download all similar extensions for VS (pip manager, pip installer, Pypi assistant) and then entered “pip install fortls” (and similar commands) in terminal but it clearly didn’t change anything. Also I tried to find it via links, but it’s even more not understandable what I should download and in which order. All guides/forums I read implies that I already know how to download PyPi / pip, but I’m not.
To be honest I even don’t understand why Modern Fortran downloads c++ extension, but uses packages written on Python.
I would very appreciate if someone will explain me what exactly I should do to install fortls and get Modern Fortran to work. I spent already 4+ hours only on this, and don’t have any hope to deal with it on my own. I only had an experience with C# in VS, so all this things with downloading different packages to download different servers and extensions is very hard for me
Here are possible steps, which you should follow (copying text from the page mentioned above):
Allow for fortls to be automatically installed with pip or Anaconda and if the location where fortls is installed is not in your PATH point VS Code to the fortls location by setting
Linting: may be you can safely ignore if you are using gfortran.
By default, the linter used is gfortran, Intel’s ifort and Intel’s LLVM based compiler ifx are also supported. One can use a different linter compiler via the option
{
"fortran.linter.compiler": "ifx/gfortran"
}
Debugging: The extension uses the debugger from Microsoft’s C/C++ extension for Visual Studio Code. This allows this extension to use the full functionality of the C/C++ extension for debugging applications.
Therefore C/C++ extensions are necessary.
Formatting:
Two formatters are supported findent and fprettify. Both of them can be installed with pip automatically through the extension.
How exactly I should allow fortls be installed? I attached a screenshot of command console. Didn’t I install it?
What about “fortran.fortls.path”: “/custom/path/to/fortls”. Where should I put it? (and where I should put all commands above?) Should I change it? And also I mentined that I put the path where fortls packages were installed to the Server Language Path fortls. Is it wrong?
Sorry, but didn’t understand. I’m trying to get Modern Fortran to work. He can not compile or what?
Ok
Following same screenshot I guess I installed findent. Did I miss something?
Also installed fpretiffy but it didn’t fix anything.
Thank you in advance and sorry for probably silly questions
UPD: I think I’ve got everything except findent/fprettify. I have installed it and put the path from scripts folder to the settings, but VS still cann’t see findent/fprettify and don’t install it (error PIP: Error: spawn pip ENOENT). Do you know what the problem can be?