Skip to content

Commit 2359c83

Browse files
committed
Move code around so that exported functions are set on namespace
1 parent b959f3e commit 2359c83

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

src/tsserver/server.ts

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,6 @@ namespace ts.server {
77
Web
88
};
99

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-
3010
function parseStringArray(argName: string): readonly string[] {
3111
const arg = findArgument(argName);
3212
if (arg === undefined) {
@@ -109,4 +89,24 @@ namespace ts.server {
10989
cancellationToken
11090
);
11191
}
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+
}
112112
}

0 commit comments

Comments
 (0)