diff --git a/CHANGELOG.md b/CHANGELOG.md index 48154f87..f10de928 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -80,6 +80,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ### Fixed +- Fixed bug where specifying `-ffree-line-length-X` and `-ffixed-line-length-X` + as `linter.extraArgs` would be overridden by the default behaviour of `fortls` + ([#925](https://github.com/fortran-lang/vscode-fortran-support/issues/925)) - Fixed bug where linter would not use the correct Fortran file association if the extension was part of the default extensions of another Fortran lang ID ([#904](https://github.com/fortran-lang/vscode-fortran-support/issues/904)) diff --git a/src/lint/provider.ts b/src/lint/provider.ts index 5b0cd534..ef4a9083 100644 --- a/src/lint/provider.ts +++ b/src/lint/provider.ts @@ -555,7 +555,9 @@ export class FortranLintingProvider { if (this.linter.name === 'gfortran') { const ln: number = config.get('fortls.maxLineLength'); const lnStr: string = ln === -1 ? 'none' : ln.toString(); - args.push(`-ffree-line-length-${lnStr}`, `-ffixed-line-length-${lnStr}`); + // Prepend via `unshift` to make sure user defined flags overwrite + // the default ones we provide here. + args.unshift(`-ffree-line-length-${lnStr}`, `-ffixed-line-length-${lnStr}`); } if (args.length > 0) this.logger.debug(`[lint] arguments:`, args);