Skip to content

Commit 4ce7eff

Browse files
committed
fix: create subs globally
1 parent 708b1d2 commit 4ce7eff

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/main.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,14 @@ import { CompositeDisposable } from "atom"
22
import { SignatureHelpManager } from "./signature-help-manager"
33
import { SignatureHelpRegistry } from "atom-ide-base"
44

5-
let subscriptions: CompositeDisposable
5+
let subscriptions = new CompositeDisposable()
66
let signatureHelpManager: SignatureHelpManager
77

88
/**
99
* called by Atom when activating an extension
1010
*/
1111
export function activate() {
1212
// Events subscribed to in atom's system can be easily cleaned up with a CompositeDisposable
13-
subscriptions = new CompositeDisposable()
1413
signatureHelpManager = new SignatureHelpManager()
1514
subscriptions.add(signatureHelpManager)
1615
;(require("atom-package-deps") as typeof import("atom-package-deps"))
@@ -24,9 +23,7 @@ export function activate() {
2423
* called by Atom when deactivating an extension
2524
*/
2625
export function deactivate() {
27-
if (subscriptions) {
28-
subscriptions.dispose()
29-
}
26+
subscriptions.dispose()
3027
}
3128

3229
export function provideSignatureHelp(): SignatureHelpRegistry {

0 commit comments

Comments
 (0)