Skip to content

Commit

Permalink
fix: create subs globally
Browse files Browse the repository at this point in the history
  • Loading branch information
aminya committed Feb 6, 2021
1 parent 708b1d2 commit 4ce7eff
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@ import { CompositeDisposable } from "atom"
import { SignatureHelpManager } from "./signature-help-manager"
import { SignatureHelpRegistry } from "atom-ide-base"

let subscriptions: CompositeDisposable
let subscriptions = new CompositeDisposable()
let signatureHelpManager: SignatureHelpManager

/**
* called by Atom when activating an extension
*/
export function activate() {
// Events subscribed to in atom's system can be easily cleaned up with a CompositeDisposable
subscriptions = new CompositeDisposable()
signatureHelpManager = new SignatureHelpManager()
subscriptions.add(signatureHelpManager)
;(require("atom-package-deps") as typeof import("atom-package-deps"))
Expand All @@ -24,9 +23,7 @@ export function activate() {
* called by Atom when deactivating an extension
*/
export function deactivate() {
if (subscriptions) {
subscriptions.dispose()
}
subscriptions.dispose()
}

export function provideSignatureHelp(): SignatureHelpRegistry {
Expand Down

0 comments on commit 4ce7eff

Please sign in to comment.