Skip to content

Commit 53fb099

Browse files
committed
JSfy frontend.coffee
- and remove unused handlers - and add `notification` handler
1 parent 5487096 commit 53fb099

File tree

3 files changed

+34
-64
lines changed

3 files changed

+34
-64
lines changed

lib/runtime.coffee

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,23 +22,21 @@ module.exports =
2222

2323
@modules.activate()
2424
@completions.activate()
25-
@frontend.activate()
2625
@subs.add atom.config.observe 'julia-client.juliaOptions.formatOnSave', (val) =>
2726
if val
2827
@formatter.activate()
2928
else
3029
@formatter.deactivate()
3130

3231
@subs.add new Disposable(=>
33-
mod.deactivate() for mod in [@modules, @completions, @frontend, @formatter])
32+
mod.deactivate() for mod in [@modules, @completions, @formatter])
3433

3534
deactivate: ->
3635
@subs.dispose()
3736

3837
consumeInk: (ink) ->
3938
@evaluation.ink = ink
40-
@frontend.ink = ink
41-
for mod in [@console, @debugger, @profiler, @linter, @goto, @outline]
39+
for mod in [@console, @debugger, @profiler, @linter, @goto, @outline, @frontend]
4240
mod.activate(ink)
4341
for mod in [@workspace, @plots]
4442
mod.ink = ink

lib/runtime/frontend.coffee

Lines changed: 0 additions & 60 deletions
This file was deleted.

lib/runtime/frontend.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/** @babel */
2+
3+
import { client } from '../connection'
4+
import { selector, notifications } from '../ui'
5+
import { colors } from '../misc'
6+
7+
export function activate (ink) {
8+
client.handle({
9+
select: (items) => selector.show(items),
10+
input: () => selector.show([], { allowCustom: true }),
11+
syntaxcolors: (selectors) => colors.getColors(selectors),
12+
openFile: (file, line) => {
13+
ink.Opener.open(file, line, {
14+
pending: atom.config.get('core.allowPendingPaneItems')
15+
})
16+
},
17+
versionwarning: (msg) => {
18+
atom.notifications.addWarning("Outdated version of Atom.jl detected.", {
19+
description: msg,
20+
dismissable: true
21+
})
22+
},
23+
notify: (msg) => notifications.show(msg, true),
24+
notification: (message, kind = 'Info', options = {}) => {
25+
try {
26+
atom.notifications[`add${kind}`](message, options)
27+
} catch (err) {
28+
console.log(err)
29+
}
30+
}
31+
})
32+
}

0 commit comments

Comments
 (0)