Skip to content

Commit

Permalink
fix: remove window notifications from main activate fn
Browse files Browse the repository at this point in the history
  • Loading branch information
ivodolenc committed Dec 2, 2024
1 parent 125e754 commit e4d0703
Showing 1 changed file with 9 additions and 23 deletions.
32 changes: 9 additions & 23 deletions src/extension/index.ts
Original file line number Diff line number Diff line change
@@ -1,32 +1,18 @@
import { workspace, window } from 'vscode'
import { workspace } from 'vscode'
import { registeredCommands } from './commands'
import { detectConfigChange } from './config/detect-config-change'
import { showMessage } from './messages'
import type { ExtensionContext } from 'vscode'

export async function activate(context: ExtensionContext): Promise<void> {
try {
context.subscriptions.push(...registeredCommands())
context.subscriptions.push(...registeredCommands())

await detectConfigChange(undefined, context)
await detectConfigChange(undefined, context)

context.subscriptions.push(
workspace.onDidChangeConfiguration(
async (event) => await detectConfigChange(event, context),
),
)

const successMessage = showMessage('Activation succeeded!')
window.showInformationMessage(successMessage)
} catch {
const errorMessage = showMessage(
'Activation failed! Something went wrong, please try again.',
)
window.showErrorMessage(errorMessage)
}
context.subscriptions.push(
workspace.onDidChangeConfiguration(
async (event) => await detectConfigChange(event, context),
),
)
}

export function deactivate(): void {
const successMessage = showMessage('Deactivation succeeded!')
window.showInformationMessage(successMessage)
}
export function deactivate(): void {}

0 comments on commit e4d0703

Please sign in to comment.