Skip to content

Commit e3a79e9

Browse files
committed
[css/html/json] Randomize inspect ports to avoid conflicts
1 parent 4cd46e3 commit e3a79e9

4 files changed

Lines changed: 4 additions & 27 deletions

File tree

extensions/css-language-features/.vscode/launch.json

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,5 @@
11
{
22
"version": "0.2.0",
3-
"compounds": [
4-
{
5-
"name": "Debug Extension and Language Server",
6-
"configurations": [
7-
"Launch Extension",
8-
"Attach Language Server"
9-
]
10-
}
11-
],
123
"configurations": [
134
{
145
"name": "Launch Extension",
@@ -41,19 +32,6 @@
4132
]
4233
},
4334
{
44-
"name": "Attach Language Server",
45-
"type": "node",
46-
"request": "attach",
47-
"protocol": "inspector",
48-
"port": 6044,
49-
"sourceMaps": true,
50-
"outFiles": [
51-
"${workspaceFolder}/server/out/**/*.js"
52-
],
53-
"smartStep": true,
54-
"restart": true
55-
},
56-
{
5735
"name": "Server Unit Tests",
5836
"type": "node",
5937
"request": "launch",
@@ -74,4 +52,4 @@
7452
]
7553
}
7654
]
77-
}
55+
}

extensions/css-language-features/client/src/node/cssClientMain.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,13 @@ import { TextDecoder } from 'util';
1111

1212
// this method is called when vs code is activated
1313
export function activate(context: ExtensionContext) {
14-
1514
const clientMain = extensions.getExtension('vscode.css-language-features')?.packageJSON?.main || '';
1615

1716
const serverMain = `./server/${clientMain.indexOf('/dist/') !== -1 ? 'dist' : 'out'}/node/cssServerMain`;
1817
const serverModule = context.asAbsolutePath(serverMain);
1918

2019
// The debug options for the server
21-
const debugOptions = { execArgv: ['--nolazy', '--inspect=6044'] };
20+
const debugOptions = { execArgv: ['--nolazy', '--inspect=' + (7000 + Math.round(Math.random() * 999))] };
2221

2322
// If the extension is launch in debug mode the debug server options are use
2423
// Otherwise the run options are used

extensions/html-language-features/client/src/node/htmlClientMain.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export function activate(context: ExtensionContext) {
2424
const serverModule = context.asAbsolutePath(serverMain);
2525

2626
// The debug options for the server
27-
const debugOptions = { execArgv: ['--nolazy', '--inspect=6044'] };
27+
const debugOptions = { execArgv: ['--nolazy', '--inspect=' + (8000 + Math.round(Math.random() * 999))] };
2828

2929
// If the extension is launch in debug mode the debug server options are use
3030
// Otherwise the run options are used

extensions/json-language-features/client/src/node/jsonClientMain.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export function activate(context: ExtensionContext) {
2525
const serverModule = context.asAbsolutePath(serverMain);
2626

2727
// The debug options for the server
28-
const debugOptions = { execArgv: ['--nolazy', '--inspect=6044'] };
28+
const debugOptions = { execArgv: ['--nolazy', '--inspect=' + (6000 + Math.round(Math.random() * 999))] };
2929

3030
// If the extension is launch in debug mode the debug server options are use
3131
// Otherwise the run options are used

0 commit comments

Comments
 (0)