confluentinc / confluentinc/vscode

Migrate `activate()` and `deactivate()` logic into `src/activation/`

Open
#2,312 0 comments 0 reactions 2 assignees Claimed by @jlrobins View on GitHub
cleanup extension development testing
Dominant language
TypeScript
Stars
34
Forks
17
Avg merge
1d 22h
Merged PRs (30d)
8

Description

We can't safely test anything that requires importing from `extension.ts`, so we should move the logic out to https://github.com/confluentinc/vscode/tree/main/src/activation (possibly into separate files for maintenance/sanity benefits), and then tests should be able to import safely from there. (Which will also make `extension.ts` much smaller.)

Only other change we may want to add is when moving `deactivate()`, adding something to the effect of:
```ts
async extensionDeactivation() {
// (normal deactivate() logic here)

if (context.extensionMode === vscode.ExtensionMode.Test) {
// explicitly dispose everything that would automatically cleanup on a real deactivate() call
getExtensionContext().subscriptions.forEach((d: vscode.Disposable) => d.dispose());
}
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.