From 20724cc57bd250ceb12c0f302fde312d1d49fd57 Mon Sep 17 00:00:00 2001 From: gnikit Date: Mon, 27 Nov 2023 15:00:13 +0000 Subject: [PATCH 1/3] test(ui): add teardown for notifications --- test/ui/install-prompts.test.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/ui/install-prompts.test.ts b/test/ui/install-prompts.test.ts index ec001d21..f55a908f 100644 --- a/test/ui/install-prompts.test.ts +++ b/test/ui/install-prompts.test.ts @@ -17,6 +17,11 @@ describe('Download dependencies', () => { await browser.openResources(`${path.resolve(root, 'main.f90')}`); }); + afterEach(async () => { + const center = await new Workbench().openNotificationsCenter(); + await center.clearAllNotifications(); + }); + describe('Download fortls language server', () => { it('install via pip', async () => { const workbench = new Workbench(); From 28042febc956502fa3c70227179c2387846bdbf8 Mon Sep 17 00:00:00 2001 From: gnikit Date: Mon, 27 Nov 2023 15:01:32 +0000 Subject: [PATCH 2/3] chore: formatting changes --- README.md | 4 ++-- src/lint/provider.ts | 5 ++++- src/lsp/client.ts | 5 ++++- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index dd6285cc..4342a1c2 100644 --- a/README.md +++ b/README.md @@ -105,7 +105,7 @@ Linting results can be improved by providing additional options to the compiler. You can control the include paths to be used by the linter with the `fortran.linter.includePaths` option. | ❗️ Important | For the best linting results `linter.includePaths` should match the included paths for your project's compilation. | -| ------------- | ------------------------------------------------------------------------------------------------------------------ | +| ------------ | ------------------------------------------------------------------------------------------------------------------ | ```json { @@ -114,7 +114,7 @@ You can control the include paths to be used by the linter with the `fortran.lin ``` | ❗️ Important | If a glob pattern is used only directories matching the pattern will be included | -| ------------- | -------------------------------------------------------------------------------- | +| ------------ | -------------------------------------------------------------------------------- | ### Additional linting options diff --git a/src/lint/provider.ts b/src/lint/provider.ts index ef4a9083..8a7b9c9c 100644 --- a/src/lint/provider.ts +++ b/src/lint/provider.ts @@ -166,7 +166,10 @@ export class LinterSettings { } export class FortranLintingProvider { - constructor(private logger: Logger = new Logger(), private storageUI: string = undefined) { + constructor( + private logger: Logger = new Logger(), + private storageUI: string = undefined + ) { // Register the Linter provider this.fortranDiagnostics = vscode.languages.createDiagnosticCollection('Fortran'); this.settings = new LinterSettings(this.logger); diff --git a/src/lsp/client.ts b/src/lsp/client.ts index 7543cee8..5789f2d8 100644 --- a/src/lsp/client.ts +++ b/src/lsp/client.ts @@ -26,7 +26,10 @@ import { export const clients: Map = new Map(); export class FortlsClient { - constructor(private logger: Logger, private context?: vscode.ExtensionContext) { + constructor( + private logger: Logger, + private context?: vscode.ExtensionContext + ) { this.logger.debug('[lsp.client] Fortran Language Server -- constructor'); // if context is present From 717d5113fb74076c1817359156bcfae2b4dc4f45 Mon Sep 17 00:00:00 2001 From: gnikit Date: Mon, 27 Nov 2023 15:23:12 +0000 Subject: [PATCH 3/3] test(ui): ensure the notification is from the ext --- test/ui/install-prompts.test.ts | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/test/ui/install-prompts.test.ts b/test/ui/install-prompts.test.ts index f55a908f..88e54dd7 100644 --- a/test/ui/install-prompts.test.ts +++ b/test/ui/install-prompts.test.ts @@ -31,9 +31,12 @@ describe('Download dependencies', () => { const message = await info.getMessage(); const actions = await info.getActions(); const title = await actions[0].getTitle(); - console.log(message); - await info.takeAction(title); - strictEqual(title, 'Install'); + const source = await info.getSource(); + if (source.includes('Modern Fortran')) { + console.log(message); + await info.takeAction(title); + strictEqual(title, 'Install'); + } } }); }); @@ -48,9 +51,12 @@ describe('Download dependencies', () => { const message = await info.getMessage(); const actions = await info.getActions(); const title = await actions[0].getTitle(); - console.log(`2nd lool: ${message}`); - await info.takeAction(title); - strictEqual(title, 'Install'); + const source = await info.getSource(); + if (source.includes('Modern Fortran')) { + console.log(message); + await info.takeAction(title); + strictEqual(title, 'Install'); + } } }); });