Auto start

This commit is contained in:
2026-02-08 12:26:37 +01:00
parent a4b07f4fd2
commit a79b653b05
2 changed files with 19 additions and 2 deletions
+10
View File
@@ -51,6 +51,16 @@
"when": "devrun.serverActive"
}
]
},
"configuration": {
"title": "DevRun",
"properties": {
"devrun.autoStartServer": {
"type": "boolean",
"default": false,
"description": "Automatically start the server when vscode starts"
}
}
}
},
"scripts": {
+9 -2
View File
@@ -3,8 +3,7 @@ import { currentRun, startRun, stopRun } from "./run";
import { startServer, stopServer } from "./server";
export function activate(context: vscode.ExtensionContext) {
console.log("dev-run Activated");
const config = vscode.workspace.getConfiguration("devrun");
const statusBarItem = vscode.window.createStatusBarItem(
vscode.StatusBarAlignment.Left,
10,
@@ -49,6 +48,14 @@ export function activate(context: vscode.ExtensionContext) {
stopServer(statusBarItem),
),
);
console.log("dev-run Activated");
const autoStart = config.get<boolean>("autoStartServer");
if (autoStart) {
startServer(statusBarItem);
console.log("dev-run server auto started!");
}
}
export function deactivate() {