fortran-lang/vscode-fortran-support

Fortls on Windows - Unable to build/debug Fortran files.

anoban opened this issue · 0 comments

Does fortls support debugging on Windows?

I have a Windows 11 machine with a complete installation of Visual Studio 2022 with C++ workload (17.5.3), and Visual Studio Code (Version: 1.77.0 (system setup)) with Modern Fortran and Microsoft's C/C++ extensions installed.

I use OneAPI's ifx as my compiler. The problem is that I cannot find an option to build and debug Fortran programmes within Visual Studio Code. With C programmes, I get a Run C/C++ file and Debug C/C++ file buttons (A "Play" button) in addition to the Run and Debug button in the Activity Bar. But with Fortran programmes, this "Play" button is not available and the Run and Debug button in the Activity Bar doesn't seem to work.

When I click the blue Run and Debug button, VSCode prompts "Select debugger" and shows Python and "Install an extension for Fortran" as the two available debuggers. (VSCode was invoked from Intel OneAPI command prompt, so all the necessary variables were set). The C/C++ extension works perfectly with C files for compilation and debugging using "tasks.json" and "launch.json". I even tried the example launch.json provided in the Modern Fortran extensions's page and It appears to be configured to use GDB (Which makes me wonder is MSVC even supported?) and I couldn't get it to work either.

Perhaps this is not the place to say this, but Modern Fortran doesn't recognize "findent.exe" in Windows. Even after adding findent.exe's full path to system PATH and providing it to the extension's "formatter" arg, the extension keeps saying "Installing findent with pip with --User option".

Are there any ways to solve these issues?