@@ -5,12 +5,12 @@ import { CompositeDisposable, Disposable } from 'atom';
5
5
import modules from './runtime/modules'
6
6
import * as environments from './runtime/environments'
7
7
import evaluation from './runtime/evaluation'
8
- import * as console from './runtime/console'
8
+ import * as repl from './runtime/console' // console is a is a reserved keyword
9
9
import completions from './runtime/completions'
10
10
import workspace from './runtime/workspace'
11
11
import plots from './runtime/plots'
12
12
import * as frontend from './runtime/frontend'
13
- import * as debug from './runtime/debugger'
13
+ import * as debug from './runtime/debugger' // debugger is a is a reserved keyword
14
14
import * as profiler from './runtime/profiler'
15
15
import * as outline from './runtime/outline'
16
16
import * as linter from './runtime/linter'
@@ -20,88 +20,87 @@ import * as formatter from './runtime/formatter'
20
20
import goto from './runtime/goto'
21
21
import handleURI from "./runtime/urihandler" ;
22
22
23
+ exports . modules = modules
24
+ exports . environments = environments
25
+ exports . evaluation = evaluation
26
+ exports . repl = repl
27
+ exports . completions = completions
28
+ exports . workspace = workspace
29
+ exports . plots = plots
30
+ exports . frontend = frontend
31
+ exports . debug = debug
32
+ exports . profiler = profiler
33
+ exports . outline = outline
34
+ exports . linter = linter
35
+ exports . packages = packages
36
+ exports . debuginfo = debuginfo
37
+ exports . formatter = formatter
38
+ exports . goto = goto
39
+ exports . handleURI = handleURI
23
40
24
- export default {
25
- // TODO remove these from the export default and export them directly (prevents expensive copy)
26
- // TODO don't use this.message use message directly (prevents expensive copy)
27
- modules : modules ,
28
- environments : environments ,
29
- evaluation : evaluation ,
30
- console : console ,
31
- completions : completions ,
32
- workspace : workspace ,
33
- plots : plots ,
34
- frontend : frontend ,
35
- debugger : debug ,
36
- profiler : profiler ,
37
- outline : outline ,
38
- linter : linter ,
39
- packages : packages ,
40
- debuginfo : debuginfo ,
41
- formatter : formatter ,
42
- goto : goto ,
41
+ let subs ;
43
42
44
- activate ( ) {
45
- this . subs = new CompositeDisposable ( ) ;
43
+ export function activate ( ) {
44
+ subs = new CompositeDisposable ( ) ;
46
45
47
- this . modules . activate ( ) ;
48
- this . completions . activate ( ) ;
49
- this . subs . add ( atom . config . observe ( 'julia-client.juliaOptions.formatOnSave' , val => {
46
+ modules . activate ( ) ;
47
+ completions . activate ( ) ;
48
+ subs . add ( atom . config . observe ( 'julia-client.juliaOptions.formatOnSave' , val => {
50
49
if ( val ) {
51
- this . formatter . activate ( ) ;
50
+ formatter . activate ( ) ;
52
51
} else {
53
- this . formatter . deactivate ( ) ;
52
+ formatter . deactivate ( ) ;
54
53
}
55
54
} )
56
55
) ;
57
56
58
- this . subs . add ( new Disposable ( ( ) => {
59
- [ this . modules , this . completions , this . formatter ] . map ( ( mod ) => mod . deactivate ( ) ) ;
57
+ subs . add ( new Disposable ( ( ) => {
58
+ [ modules , completions , formatter ] . map ( ( mod ) => mod . deactivate ( ) ) ;
60
59
} )
61
60
) ;
62
- } ,
61
+ }
63
62
64
- deactivate ( ) {
65
- this . subs . dispose ( ) ;
66
- } ,
63
+ export function deactivate ( ) {
64
+ subs . dispose ( ) ;
65
+ }
67
66
68
- consumeInk ( ink ) {
69
- this . evaluation . ink = ink ;
70
- for ( let mod of [ this . console , this . debugger , this . profiler , this . linter , this . goto , this . outline , this . frontend ] ) {
67
+ export function consumeInk ( ink ) {
68
+ evaluation . ink = ink ;
69
+ for ( let mod of [ repl , debug , profiler , linter , goto , outline , frontend ] ) {
71
70
mod . activate ( ink ) ;
72
71
}
73
- for ( let mod of [ this . workspace , this . plots ] ) {
72
+ for ( let mod of [ workspace , plots ] ) {
74
73
mod . ink = ink ;
75
74
mod . activate ( ) ;
76
75
}
77
76
78
- this . subs . add (
77
+ subs . add (
79
78
new Disposable ( ( ) => {
80
- for ( let mod of [ this . console , this . debugger , this . profiler , this . linter , this . goto , this . outline ] ) {
79
+ for ( let mod of [ repl , debug , profiler , linter , goto , outline ] ) {
81
80
mod . deactivate ( ) ;
82
81
}
83
82
} )
84
83
) ;
85
84
86
- this . environments . consumeInk ( ink ) ;
87
- } ,
85
+ environments . consumeInk ( ink ) ;
86
+ }
88
87
89
- provideAutoComplete ( ) { return this . completions ; } ,
88
+ export function provideAutoComplete ( ) { return completions ; }
90
89
91
- provideHyperclick ( ) { return this . goto . provideHyperclick ( ) ; } ,
90
+ export function provideHyperclick ( ) { return goto . provideHyperclick ( ) ; }
92
91
93
- consumeStatusBar ( bar ) {
94
- const m = this . modules . consumeStatusBar ( bar ) ;
95
- const e = this . environments . consumeStatusBar ( bar ) ;
92
+ export function consumeStatusBar ( bar ) {
93
+ const m = modules . consumeStatusBar ( bar ) ;
94
+ const e = environments . consumeStatusBar ( bar ) ;
96
95
const d = new Disposable ( ( ) => {
97
96
m . dispose ( ) ;
98
97
e . dispose ( ) ;
99
98
} ) ;
100
- this . subs . add ( d ) ;
99
+ subs . add ( d ) ;
101
100
return d ;
102
- } ,
101
+ }
103
102
104
- consumeDatatip ( datatipService ) {
103
+ export function consumeDatatip ( datatipService ) {
105
104
const datatipProvider = require ( './runtime/datatip' ) ;
106
105
// @NOTE : Check if the service is passed by Atom-IDE-UI's datatip service:
107
106
// currently atom-ide-datatip can't render code snippets correctly.
@@ -116,9 +115,7 @@ export default {
116
115
) ;
117
116
}
118
117
const datatipDisposable = datatipService . addProvider ( datatipProvider ) ;
119
- this . subs . add ( datatipDisposable ) ;
118
+ subs . add ( datatipDisposable ) ;
120
119
return datatipDisposable ;
121
- } ,
120
+ }
122
121
123
- handleURI : handleURI ,
124
- } ;
0 commit comments