@@ -7,26 +7,6 @@ namespace ts.server {
7
7
Web
8
8
} ;
9
9
10
- const systemKind = typeof process !== "undefined" ? SystemKind . Node : SystemKind . Web ;
11
- const platform = ( ) => systemKind === SystemKind . Web ? "web" : require ( "os" ) . platform ( ) ;
12
- setStackTraceLimit ( ) ;
13
- switch ( systemKind ) {
14
- case SystemKind . Node :
15
- start ( initializeNodeSystem ( ) ) ;
16
- break ;
17
- case SystemKind . Web :
18
- // Get args from first message
19
- const listener = ( e : any ) => {
20
- removeEventListener ( "message" , listener ) ;
21
- const args = e . data ;
22
- start ( initializeWebSystem ( args ) ) ;
23
- } ;
24
- addEventListener ( "message" , listener ) ;
25
- break ;
26
- default :
27
- Debug . assertNever ( systemKind , "Unknown system kind" ) ;
28
- }
29
-
30
10
function parseStringArray ( argName : string ) : readonly string [ ] {
31
11
const arg = findArgument ( argName ) ;
32
12
if ( arg === undefined ) {
@@ -109,4 +89,24 @@ namespace ts.server {
109
89
cancellationToken
110
90
) ;
111
91
}
92
+
93
+ const systemKind = typeof process !== "undefined" ? SystemKind . Node : SystemKind . Web ;
94
+ const platform = ( ) => systemKind === SystemKind . Web ? "web" : require ( "os" ) . platform ( ) ;
95
+ setStackTraceLimit ( ) ;
96
+ switch ( systemKind ) {
97
+ case SystemKind . Node :
98
+ start ( initializeNodeSystem ( ) ) ;
99
+ break ;
100
+ case SystemKind . Web :
101
+ // Get args from first message
102
+ const listener = ( e : any ) => {
103
+ removeEventListener ( "message" , listener ) ;
104
+ const args = e . data ;
105
+ start ( initializeWebSystem ( args ) ) ;
106
+ } ;
107
+ addEventListener ( "message" , listener ) ;
108
+ break ;
109
+ default :
110
+ Debug . assertNever ( systemKind , "Unknown system kind" ) ;
111
+ }
112
112
}
0 commit comments