Skip to content

Commit 55d878e

Browse files
committed
Remove hardcoded VSCODE_DEV=1
This causes VS Code to use the development HTML file. Move this to the watch command instead. I deleted the other stuff before it as well since in the latest main.js they do not have this code so I figure we should be safe to omit it.
1 parent a413abf commit 55d878e

File tree

2 files changed

+2
-29
lines changed

2 files changed

+2
-29
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"lint": "./ci/dev/lint.sh",
2929
"test": "echo 'Run yarn test:unit or yarn test:e2e' && exit 1",
3030
"ci": "./ci/dev/ci.sh",
31-
"watch": "VSCODE_IPC_HOOK_CLI= NODE_OPTIONS='--max_old_space_size=32384 --trace-warnings' ts-node ./ci/dev/watch.ts",
31+
"watch": "VSCODE_DEV=1 VSCODE_IPC_HOOK_CLI= NODE_OPTIONS='--max_old_space_size=32384 --trace-warnings' ts-node ./ci/dev/watch.ts",
3232
"icons": "./ci/dev/gen_icons.sh",
3333
"coverage": "codecov"
3434
},

src/node/routes/vscode.ts

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import * as express from "express"
2-
import path from "path"
32
import { DefaultedArgs } from "../cli"
4-
import { vsRootPath } from "../constants"
53
import { ensureAuthenticated, authenticated, redirect } from "../http"
64
import { loadAMDModule } from "../util"
75
import { Router as WsRouter, WebsocketRouter } from "../wsRouter"
@@ -14,32 +12,7 @@ export interface VSServerResult {
1412
}
1513

1614
export const createVSServerRouter = async (args: DefaultedArgs): Promise<VSServerResult> => {
17-
// Delete `VSCODE_CWD` very early even before
18-
// importing bootstrap files. We have seen
19-
// reports where `code .` would use the wrong
20-
// current working directory due to our variable
21-
// somehow escaping to the parent shell
22-
// (https://github.com/microsoft/vscode/issues/126399)
23-
delete process.env["VSCODE_CWD"]
24-
25-
const bootstrap = require(path.join(vsRootPath, "out", "bootstrap"))
26-
const bootstrapNode = require(path.join(vsRootPath, "out", "bootstrap-node"))
27-
const product = require(path.join(vsRootPath, "product.json"))
28-
29-
// Avoid Monkey Patches from Application Insights
30-
bootstrap.avoidMonkeyPatchFromAppInsights()
31-
32-
// Enable portable support
33-
bootstrapNode.configurePortable(product)
34-
35-
// Enable ASAR support
36-
bootstrap.enableASARSupport()
37-
38-
// Signal processes that we got launched as CLI
39-
process.env["VSCODE_CLI"] = "1"
40-
// Seems to be necessary to load modules properly.
41-
process.env["VSCODE_DEV"] = "1"
42-
15+
// See ../../../vendor/modules/code-oss-dev/src/vs/server/main.js.
4316
const createVSServer = await loadAMDModule<CodeServerLib.CreateServer>(
4417
"vs/server/remoteExtensionHostAgent",
4518
"createServer",

0 commit comments

Comments
 (0)