Fortls on Windows - Unable to build/debug Fortran files. #864
-
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? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
The main issue is a duplicate of #310, I urge you to read the discussions to better understand what's going one. The secondary issue has been a frequent source of confusion, latest duplicate issue is #839. You can also find working examples of how to set the setting in the vscode extension's README. Please understand that it is difficult for us to provide one-to-one support, especially for issues that have already answered, since we are all |
Beta Was this translation helpful? Give feedback.
-
Firstly, I appreciate the assistance, thank you. I realize that this project pretty much a one man show (or it appears so) and I did not mean to waste your time. I did look up my issues on google but not here, may be I could have searched in the issues section of this repository. My bad.
I want to add some details here for clarification:
Fortran session: C session:
I'm in no way criticizing or complaining, and In fact I really appreciate the work you have done here. I just wanted to explicitly point out the issues faced in a Windows machine. I'm learning Fortran as a hobby but fluent in Python and C with can-manage-ish competency in JS. If you have any plans to to fix these or if there are any workaround implementations. (I know that you have pointed out the issue lies mainly in the interaction between Modern Fortran and MS's C/C++ extension)... I'd be delighted to help (provided my knowledge is adequate). |
Beta Was this translation helpful? Give feedback.
The main issue is a duplicate of #310, I urge you to read the discussions to better understand what's going one.
The secondary issue has been a frequent source of confusion, latest duplicate issue is #839. You can also find working examples of how to set the setting in the vscode extension's README.
Please understand that it is difficult for us to provide one-to-one support, especially for issues that have already answered, since we are all
doing this in our free time. You might want to consider asking these questions to https://fortran-lang.discourse.group/ with the #help:vscode or #help:fortls tags and instead posting only bug/feature requests on GitHub.