-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: remove window notifications from main activate fn
- Loading branch information
Showing
1 changed file
with
9 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 {} |