Initial stab at adding more launch configurations

This commit is contained in:
Kirill Dubovitskiy 2023-08-05 02:15:20 -07:00
parent 178e180e9c
commit 5713995299
3 changed files with 79 additions and 12 deletions

31
.vscode/launch.json vendored
View file

@ -5,13 +5,34 @@
"version": "0.2.0",
"configurations": [
{
"name": "Python: Module",
"name": "Server",
"type": "python",
"request": "launch",
"module": "continuedev.src.continuedev.server.main",
"args": ["--port", "8001"],
"args": [
"--port",
"8001"
],
"justMyCode": false,
"subProcess": false
}
"subProcess": false,
// Does it need a build task?
// What about a watch task? - type errors?
},
{
"name": "VSCode Extension",
"type": "extensionHost",
"request": "launch",
"cwd": "${workspaceFolder}/extension",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}/extension",
],
"outFiles": [
"${workspaceFolder}/extension/out/**/*.js"
],
"preLaunchTask": "vscode-extension:build-watch",
"env": {
"CONTINUE_SERVER_URL": "http://localhost:8001"
}
},
]
}
}

49
.vscode/tasks.json vendored Normal file
View file

@ -0,0 +1,49 @@
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
{
"version": "2.0.0",
"tasks": [
{
"label": "vscode-extension:build-watch",
"type": "npm",
"script": "esbuild-watch",
"path": "extension",
"isBackground": true,
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": [
// We rely on tsc to emit type errors in a separate task
],
// Depends on prevents the task from running until the other task has completed, not want we want
// does not start the extension
// "dependsOn": [
// // esbuild does not emit type errors so we need a separate task for that
// // https://esbuild.github.io/content-types/#typescript
// "vscode-extension:tsc-watch"
// ]
},
{
"label": "vscode-extension:tsc-watch",
"type": "npm",
"script": "watch",
"path": "extension",
"isBackground": true,
"problemMatcher": [
"$tsc-watch"
],
// Problems are currently broken due to path resolution not being relative to the workspace root
// The way cursorless does it it by having top level package.json which is not ideal.
// Multi root workspaces would help here
"presentation": {
"revealProblems": "onProblem",
"clear": true
},
"group": {
"kind": "build",
"isDefault": true
}
}
]
}

View file

@ -1,14 +1,11 @@
import * as vscode from "vscode";
import { extensionContext } from "./activation/activate";
export function getContinueServerUrl() {
// If in debug mode, always use 8001
if (
extensionContext &&
extensionContext.extensionMode === vscode.ExtensionMode.Development
) {
return "http://localhost:8001";
// Passed in from launch.json
if (process.env.CONTINUE_SERVER_URL) {
return process.env.CONTINUE_SERVER_URL;
}
return (
vscode.workspace.getConfiguration("continue").get<string>("serverUrl") ||
"http://localhost:65432"