Skip to content

Commit c5a9573

Browse files
committed
Ensure ts object passed to plugins contains deprecatedCompat declarations
We pass the entire "ts" object into plugins. However, we need to make sure that that object contains the debug compat helpers. In the old codebase, the deprecated compat code would tack things onto the actual ts object, after the server code was executed, and later that same object would be given to plugins. But in modules, each TS project only sees the view of the "ts" namespace that their references implied, not the ts object as some sort of singleton. To ensure that plugins get the debug compat code, we have to bring that into each project's view of the ts namespace, and not add it on later in the executable projects.
1 parent db440d8 commit c5a9573

File tree

6 files changed

+6
-7
lines changed

6 files changed

+6
-7
lines changed

src/server/_namespaces/ts.ts

+2
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,7 @@
33
export * from "../../compiler/_namespaces/ts";
44
export * from "../../jsTyping/_namespaces/ts";
55
export * from "../../services/_namespaces/ts";
6+
// Pull this in here so that plugins loaded by the server see compat wrappers.
7+
export * from "../../deprecatedCompat/_namespaces/ts";
68
import * as server from "./ts.server";
79
export { server };

src/server/tsconfig.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
"references": [
99
{ "path": "../compiler" },
1010
{ "path": "../jsTyping" },
11-
{ "path": "../services" }
11+
{ "path": "../services" },
12+
{ "path": "../deprecatedCompat" }
1213
],
1314
"include": ["**/*"]
1415
}

src/tsserver/_namespaces/ts.ts

-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,5 @@ export * from "../../services/_namespaces/ts";
55
export * from "../../jsTyping/_namespaces/ts";
66
export * from "../../server/_namespaces/ts";
77
export * from "../../webServer/_namespaces/ts";
8-
export * from "../../deprecatedCompat/_namespaces/ts";
98
import * as server from "./ts.server";
109
export { server };

src/tsserver/tsconfig.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@
1111
{ "path": "../services" },
1212
{ "path": "../jsTyping" },
1313
{ "path": "../server" },
14-
{ "path": "../webServer" },
15-
{ "path": "../deprecatedCompat" }
14+
{ "path": "../webServer" }
1615
],
1716
"include": ["**/*"]
1817
}

src/tsserverlibrary/_namespaces/ts.ts

-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,5 @@ export * from "../../compiler/_namespaces/ts";
44
export * from "../../jsTyping/_namespaces/ts";
55
export * from "../../services/_namespaces/ts";
66
export * from "../../server/_namespaces/ts";
7-
export * from "../../deprecatedCompat/_namespaces/ts";
87
import * as server from "./ts.server";
98
export { server };

src/tsserverlibrary/tsconfig.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
{ "path": "../compiler" },
77
{ "path": "../jsTyping" },
88
{ "path": "../services" },
9-
{ "path": "../server" },
10-
{ "path": "../deprecatedCompat" }
9+
{ "path": "../server" }
1110
],
1211
"include": ["**/*"]
1312
}

0 commit comments

Comments
 (0)