mirror of
https://github.com/Microsoft/vscode
synced 2024-10-02 17:32:41 +00:00
[css/html/json] Randomize inspect ports to avoid conflicts
This commit is contained in:
parent
4cd46e32b2
commit
e3a79e9e44
|
@ -1,14 +1,5 @@
|
||||||
{
|
{
|
||||||
"version": "0.2.0",
|
"version": "0.2.0",
|
||||||
"compounds": [
|
|
||||||
{
|
|
||||||
"name": "Debug Extension and Language Server",
|
|
||||||
"configurations": [
|
|
||||||
"Launch Extension",
|
|
||||||
"Attach Language Server"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"configurations": [
|
"configurations": [
|
||||||
{
|
{
|
||||||
"name": "Launch Extension",
|
"name": "Launch Extension",
|
||||||
|
@ -41,19 +32,6 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Attach Language Server",
|
|
||||||
"type": "node",
|
|
||||||
"request": "attach",
|
|
||||||
"protocol": "inspector",
|
|
||||||
"port": 6044,
|
|
||||||
"sourceMaps": true,
|
|
||||||
"outFiles": [
|
|
||||||
"${workspaceFolder}/server/out/**/*.js"
|
|
||||||
],
|
|
||||||
"smartStep": true,
|
|
||||||
"restart": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Server Unit Tests",
|
"name": "Server Unit Tests",
|
||||||
"type": "node",
|
"type": "node",
|
||||||
"request": "launch",
|
"request": "launch",
|
||||||
|
@ -74,4 +52,4 @@
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,14 +11,13 @@ import { TextDecoder } from 'util';
|
||||||
|
|
||||||
// this method is called when vs code is activated
|
// this method is called when vs code is activated
|
||||||
export function activate(context: ExtensionContext) {
|
export function activate(context: ExtensionContext) {
|
||||||
|
|
||||||
const clientMain = extensions.getExtension('vscode.css-language-features')?.packageJSON?.main || '';
|
const clientMain = extensions.getExtension('vscode.css-language-features')?.packageJSON?.main || '';
|
||||||
|
|
||||||
const serverMain = `./server/${clientMain.indexOf('/dist/') !== -1 ? 'dist' : 'out'}/node/cssServerMain`;
|
const serverMain = `./server/${clientMain.indexOf('/dist/') !== -1 ? 'dist' : 'out'}/node/cssServerMain`;
|
||||||
const serverModule = context.asAbsolutePath(serverMain);
|
const serverModule = context.asAbsolutePath(serverMain);
|
||||||
|
|
||||||
// The debug options for the server
|
// The debug options for the server
|
||||||
const debugOptions = { execArgv: ['--nolazy', '--inspect=6044'] };
|
const debugOptions = { execArgv: ['--nolazy', '--inspect=' + (7000 + Math.round(Math.random() * 999))] };
|
||||||
|
|
||||||
// If the extension is launch in debug mode the debug server options are use
|
// If the extension is launch in debug mode the debug server options are use
|
||||||
// Otherwise the run options are used
|
// Otherwise the run options are used
|
||||||
|
|
|
@ -24,7 +24,7 @@ export function activate(context: ExtensionContext) {
|
||||||
const serverModule = context.asAbsolutePath(serverMain);
|
const serverModule = context.asAbsolutePath(serverMain);
|
||||||
|
|
||||||
// The debug options for the server
|
// The debug options for the server
|
||||||
const debugOptions = { execArgv: ['--nolazy', '--inspect=6044'] };
|
const debugOptions = { execArgv: ['--nolazy', '--inspect=' + (8000 + Math.round(Math.random() * 999))] };
|
||||||
|
|
||||||
// If the extension is launch in debug mode the debug server options are use
|
// If the extension is launch in debug mode the debug server options are use
|
||||||
// Otherwise the run options are used
|
// Otherwise the run options are used
|
||||||
|
|
|
@ -25,7 +25,7 @@ export function activate(context: ExtensionContext) {
|
||||||
const serverModule = context.asAbsolutePath(serverMain);
|
const serverModule = context.asAbsolutePath(serverMain);
|
||||||
|
|
||||||
// The debug options for the server
|
// The debug options for the server
|
||||||
const debugOptions = { execArgv: ['--nolazy', '--inspect=6044'] };
|
const debugOptions = { execArgv: ['--nolazy', '--inspect=' + (6000 + Math.round(Math.random() * 999))] };
|
||||||
|
|
||||||
// If the extension is launch in debug mode the debug server options are use
|
// If the extension is launch in debug mode the debug server options are use
|
||||||
// Otherwise the run options are used
|
// Otherwise the run options are used
|
||||||
|
|
Loading…
Reference in a new issue