Skip to content

Commit 1ede7d7

Browse files
committed
bug: copy linter arguments via deep copy
1 parent 27eb40d commit 1ede7d7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/features/linter-provider.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ export class FortranLintingProvider {
279279
const textDocument = textEditor.document;
280280
this.linter = this.getLinter(this.settings.compiler);
281281
const command = this.getLinterExecutable();
282-
let argList = this.constructArgumentList(textDocument);
282+
let argList = [...this.constructArgumentList(textDocument)];
283283
// Remove mandatory linter args, used for mock compilation
284284
argList = argList.filter(arg => !this.linter.args.includes(arg));
285285
if (debug) argList.push('-g'); // add debug symbols flag, same for all compilers
@@ -417,7 +417,8 @@ export class FortranLintingProvider {
417417
*/
418418
private getLinterExtraArgs(): string[] {
419419
const config = vscode.workspace.getConfiguration(EXTENSION_ID);
420-
let args: string[] = this.linter.argsDefault;
420+
// Get the linter arguments from the settings via a deep copy
421+
let args: string[] = [...this.linter.argsDefault];
421422
const user_args: string[] = this.settings.args;
422423
// If we have specified linter.extraArgs then replace default arguments
423424
if (user_args.length > 0) args = user_args.slice();

0 commit comments

Comments
 (0)