Fortitude extension for Visual Studio CodeA Visual Studio Code extension for Fortitude, an extremely fast Fortran linter and code formatter, written in Rust. Available on the Visual Studio Marketplace. Fortitude can be used to replace Flake8 (plus dozens of plugins), Black, isort, pyupgrade, and more, all while executing tens or hundreds of times faster than any individual tool. The extension ships with
UsageOnce installed in Visual Studio Code, If you want to disable Fortitude, you can disable this extension per workspace in Visual Studio Code. Fix safetyFortitude's automatic fixes are labeled as "safe" and "unsafe". By default, the
"Fix all" action will not apply unsafe fixes. However, unsafe fixes can be
applied manually with the "Quick fix" action. Application of unsafe fixes when
using "Fix all" can be enabled by setting See the Fortitude fix docs for more details on how fix safety works. Untrusted WorkspaceThe extension supports loading in an untrusted
workspace. When the
workspace is untrusted, the extension will always use the bundled executable of
the The following settings are not supported in an untrusted workspace: SettingsRefer to the Fortitude Language Server documentation for a full list of settings available in the extension. Configuring VS CodeYou can configure Fortitude to fix lint violations on-save by enabling the
Configuring FortitudeThe Fortitude VS Code extension will respect any Fortitude configuration as
defined in your project's You can also configure some common settings in VS Code directly, like
To use a custom configuration file, set the
Finally, to use a common Fortitude configuration across all projects, consider creating a user-specific
Fortran-based language server (
|
| Command | Description |
|---|---|
| Fortitude: Fix all auto-fixable problems | Fix all auto-fixable problems |
| Fortitude: Restart Server | Force restart the linter server |
| Fortitude: Print debug information | Print debug information about the native server |
| Fortitude: Show client logs | Open the Fortitude output channel |
| Fortitude: Show server logs | Open the Fortitude Language Server output channel |
Requirements
This extension requires a version of the VSCode Python extension that supports Python 3.7+. Fortitude itself is compatible with Python 3.7 to 3.15.
Troubleshooting
If you encounter any issues with the extension or the language server, please refer to the logs in the corresponding output channel in VS Code. The extension logs are in the "Fortitude" output channel and the language server logs are in the "Fortitude Language Server" output channel.
To open the output panel, use the Output: Show Output Channels command in the command palette
(Ctrl+Shift+P or Cmd+Shift+P), then select "Fortitude" or "Fortitude Language Server". Alternatively,
you can use the Fortitude: Show client logs and Fortitude: Show server logs command to open the "Fortitude"
and "Fortitude Language Server" output channel respectively. The Fortitude: Print debug information command
can be used to print debug information which can include details about the current open file.
The default log level for the extension is info which can be changed from the output panel using
the settings icon in the top right corner of the panel.
The default log level for the language server is info which can be changed using the fortitude.logLevel
setting in your settings.json:
{
"fortitude.logLevel": "info"
}
The language server logs can be directed to a file by setting the fortitude.logFile setting in
your settings.json:
{
"fortitude.logFile": "/path/to/fortitude.log"
}
To capture the LSP messages between the editor and the server, set the fortitude.trace.server
setting to either messages or verbose in your settings.json:
{
"fortitude.trace.server": "messages"
}
This will be visible in the "Fortitude Language Server Trace" output channel. The difference between
messages and verbose is that messages only logs the method name for both the request
and response, while verbose also logs the request parameters sent by the client and the
response result sent by the server.
The extension also displays certain information in the status bar. This can be pinned to the status bar as a permanent item.
License
MIT