@@ -9,70 +9,69 @@ import client from './connection/client'
9
9
import local from './connection/local'
10
10
import terminal from './connection/terminal'
11
11
12
- export default {
13
- // TODO remove these from the export default and export them directly (prevents expensive copy)
14
- // TODO don't use this.message use message directly (prevents expensive copy)
15
- IPC : IPC ,
16
- messages : messages ,
17
- client : client ,
18
- local : local ,
19
- terminal : terminal ,
12
+ exports . IPC = IPC
13
+ exports . messages = messages
14
+ exports . client = client
15
+ exports . local = local
16
+ exports . terminal = terminal
20
17
21
- activate ( ) {
22
- this . messages . activate ( ) ;
23
- this . client . activate ( ) ;
24
- this . client . boot = ( ) => this . boot ( ) ;
25
- this . local . activate ( ) ;
26
- this . booting = false ;
27
- } ,
18
+ let booting = false ;
19
+ let ink ;
28
20
29
- deactivate ( ) {
30
- this . client . deactivate ( ) ;
31
- } ,
21
+ export function activate ( ) {
22
+ messages . activate ( ) ;
23
+ client . activate ( ) ;
24
+ client . boot = ( ) => boot ( ) ;
25
+ local . activate ( ) ;
26
+ booting = false ;
27
+ }
32
28
33
- consumeInk ( ink ) {
34
- this . IPC . consumeInk ( ink ) ;
35
- this . ink = ink ;
36
- } ,
29
+ export function deactivate ( ) {
30
+ client . deactivate ( ) ;
31
+ }
37
32
38
- consumeGetServerConfig ( getconf ) {
39
- this . local . consumeGetServerConfig ( getconf ) ;
40
- } ,
33
+ export function consumeInk ( ink_in ) {
34
+ ink = ink_in ;
35
+ IPC . consumeInk ( ink ) ;
36
+ }
41
37
42
- consumeGetServerName ( name ) {
43
- this . local . consumeGetServerName ( name ) ;
44
- } ,
38
+ export function consumeGetServerConfig ( getconf ) {
39
+ local . consumeGetServerConfig ( getconf ) ;
40
+ }
45
41
46
- _boot ( provider ) {
47
- if ( ! this . client . isActive ( ) && ! this . booting ) {
48
- this . booting = true ;
49
- this . client . setBootMode ( provider ) ;
42
+ export function consumeGetServerName ( name ) {
43
+ local . consumeGetServerName ( name ) ;
44
+ }
45
+
46
+ export function _boot ( provider ) {
47
+ if ( ! client . isActive ( ) && ! booting ) {
48
+ booting = true ;
49
+ client . setBootMode ( provider ) ;
50
50
51
51
let p ;
52
52
if ( provider === 'External Terminal' ) {
53
53
p = externalTerminal . connectedRepl ( ) ;
54
54
} else {
55
- p = this . local . start ( provider ) ;
55
+ p = local . start ( provider ) ;
56
56
}
57
57
58
- if ( this . ink ) {
59
- this . ink . Opener . allowRemoteFiles ( provider === 'Remote' ) ;
58
+ if ( ink ) {
59
+ ink . Opener . allowRemoteFiles ( provider === 'Remote' ) ;
60
60
}
61
61
p . then ( ( ) => {
62
- this . booting = false ;
62
+ booting = false ;
63
63
} ) ;
64
64
p . catch ( ( ) => {
65
- this . booting = false ;
65
+ booting = false ;
66
66
} ) ;
67
- return time ( "Julia Boot" , this . client . import ( 'ping' ) ( ) ) ;
67
+ return time ( "Julia Boot" , client . import ( 'ping' ) ( ) ) ;
68
68
}
69
- } ,
69
+ }
70
70
71
- bootRemote ( ) {
72
- return this . _boot ( 'Remote' ) ;
73
- } ,
71
+ export function bootRemote ( ) {
72
+ return _boot ( 'Remote' ) ;
73
+ }
74
74
75
- boot ( ) {
76
- return this . _boot ( atom . config . get ( 'julia-client.juliaOptions.bootMode' ) ) ;
77
- }
78
- } ;
75
+ export function boot ( ) {
76
+ return _boot ( atom . config . get ( 'julia-client.juliaOptions.bootMode' ) ) ;
77
+ }
0 commit comments