-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Use module level variables - export functions directly - no null set is needed in deactivate - fix import and types
- Loading branch information
Showing
3 changed files
with
51 additions
and
75 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import { CompositeDisposable } from "atom" | ||
import { SignatureHelpManager } from "./signature-help-manager" | ||
import { SignatureHelpRegistry } from "atom-ide-base" | ||
|
||
let subscriptions: 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() | ||
if (!signatureHelpManager) signatureHelpManager = new SignatureHelpManager() | ||
subscriptions.add(signatureHelpManager) | ||
require("atom-package-deps") | ||
.install("atom-ide-signature-help") | ||
.then(() => { | ||
signatureHelpManager.initialize(renderer) | ||
}) | ||
} | ||
|
||
/** | ||
* called by Atom when deactivating an extension | ||
*/ | ||
export function deactivate() { | ||
if (subscriptions) { | ||
subscriptions.dispose() | ||
} | ||
} | ||
|
||
export function provideSignatureHelp(): SignatureHelpRegistry { | ||
return signatureHelpManager.signatureHelpRegistry | ||
} | ||
|
||
export const config = { | ||
showSignatureHelpOnTyping: { | ||
title: "Show signature automatically", | ||
description: | ||
"If set to true, the signature help is shown as soon as you start typing. Otherwise you will have to activate it via keypress.", | ||
type: "boolean", | ||
default: true, | ||
}, | ||
glowOnHover: { | ||
title: "Glow on hover", | ||
description: "Should signature glow when you hover on it?", | ||
type: "boolean", | ||
default: true, | ||
}, | ||
} |
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