diff --git a/.github/actions/build-vscode-extension/action.yml b/.github/actions/build-vscode-extension/action.yml index fb17816f2..f9c17f31b 100644 --- a/.github/actions/build-vscode-extension/action.yml +++ b/.github/actions/build-vscode-extension/action.yml @@ -18,6 +18,9 @@ inputs: description: 'Commit SHA for version modification (optional, uses first 7 chars)' required: false default: '' + github-token: + description: 'GitHub token for downloading ripgrep' + required: true outputs: target: description: 'The target string used for the build' @@ -83,7 +86,7 @@ runs: npm ci env: # https://github.com/microsoft/vscode-ripgrep/issues/9#issuecomment-643965333 - GITHUB_TOKEN: ${{ env.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ inputs.github-token }} - name: Install gui dependencies shell: bash @@ -98,6 +101,12 @@ runs: npm ci npm i vectordb + - name: Build GUI + shell: bash + run: | + cd gui + npm run build + - name: Prepackage the extension shell: bash run: | diff --git a/.github/actions/run-jetbrains-tests/action.yml b/.github/actions/run-jetbrains-tests/action.yml index 71051101d..6c2d431ff 100644 --- a/.github/actions/run-jetbrains-tests/action.yml +++ b/.github/actions/run-jetbrains-tests/action.yml @@ -28,6 +28,13 @@ runs: cd core npm ci + - name: Install gui node_modules and build + shell: bash + run: | + cd gui + npm ci + npm run build + - name: Setup Java uses: actions/setup-java@v4.5.0 with: diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 2024b083b..739553f7b 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -80,8 +80,7 @@ jobs: arch: ${{ matrix.arch }} npm_config_arch: ${{ matrix.npm_config_arch }} pre-release: false - env: - GITHUB_TOKEN: ${{ secrets.CI_GITHUB_TOKEN }} + github-token: ${{ secrets.GITHUB_TOKEN }} - name: Upload .vsix artifact uses: actions/upload-artifact@v4 diff --git a/.github/workflows/pr-build-upload-vsix.yaml b/.github/workflows/pr-build-upload-vsix.yaml index 17a3dc5ba..6a8250a83 100644 --- a/.github/workflows/pr-build-upload-vsix.yaml +++ b/.github/workflows/pr-build-upload-vsix.yaml @@ -36,8 +36,7 @@ jobs: npm_config_arch: ${{ matrix.arch }} pre-release: false commit-sha: ${{ github.sha }} - env: - GITHUB_TOKEN: ${{ secrets.CI_GITHUB_TOKEN }} + github-token: ${{ secrets.GITHUB_TOKEN }} - name: Upload build artifact uses: actions/upload-artifact@v4 diff --git a/.github/workflows/pr-checks.yaml b/.github/workflows/pr-checks.yaml index 9ea007d5f..63afde345 100644 --- a/.github/workflows/pr-checks.yaml +++ b/.github/workflows/pr-checks.yaml @@ -269,8 +269,7 @@ jobs: npm_config_arch: x64 pre-release: false commit-sha: ${{ github.sha }} - env: - GITHUB_TOKEN: ${{ secrets.CI_GITHUB_TOKEN }} + github-token: ${{ secrets.GITHUB_TOKEN }} - name: Upload build artifact uses: actions/upload-artifact@v4 diff --git a/.github/workflows/preview.yaml b/.github/workflows/preview.yaml index 611a96f5e..434588f96 100644 --- a/.github/workflows/preview.yaml +++ b/.github/workflows/preview.yaml @@ -80,8 +80,7 @@ jobs: arch: ${{ matrix.arch }} npm_config_arch: ${{ matrix.npm_config_arch }} pre-release: true - env: - GITHUB_TOKEN: ${{ secrets.CI_GITHUB_TOKEN }} + github-token: ${{ secrets.GITHUB_TOKEN }} - name: Upload .vsix artifact uses: actions/upload-artifact@v4 diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 4b8646f07..a08ec41ef 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -12,24 +12,18 @@ "isDefault": true }, "presentation": { - "reveal": "always", - "panel": "new" + "group": "dev-watchers", + "panel": "dedicated", + "reveal": "always" } }, - // Compile and bundle the extension { "label": "vscode-extension:build", "dependsOn": [ - // TSC type checking "tsc:watch", - // To build the React app that is used in the extension "vscode-extension:continue-ui:build", - // // To bundle the code the same way we do for publishing "vscode-extension:esbuild", - // To ensure extension.js is regenerated even if - // vscode-extension:esbuild was already running in background "vscode-extension:esbuild-notify", - // Start the React app that is used in the extension "gui:dev" ], "group": { @@ -42,7 +36,15 @@ "dependsOn": ["vscode-extension:esbuild"], "type": "npm", "script": "esbuild-notify", - "path": "extensions/vscode" + "path": "extensions/vscode", + "presentation": { + "group": "build-tasks", + "panel": "shared", + "reveal": "silent", + "revealProblems": "onProblem", + "close": true, + "clear": true + } }, { "label": "vscode-extension:esbuild", @@ -51,6 +53,11 @@ "script": "esbuild-watch", "path": "extensions/vscode", "isBackground": true, + "presentation": { + "group": "dev-watchers", + "panel": "dedicated", + "reveal": "silent" + }, "problemMatcher": [ { "pattern": [ @@ -77,6 +84,11 @@ "type": "npm", "script": "package", "path": "extensions/vscode", + "presentation": { + "group": "build-tasks", + "panel": "shared", + "reveal": "always" + }, "problemMatcher": [ { "pattern": [ @@ -99,7 +111,11 @@ "args": ["${workspaceFolder}/extensions/vscode/scripts/prepackage.js"], "problemMatcher": ["$tsc"], "presentation": { + "group": "build-tasks", + "panel": "shared", + "reveal": "silent", "revealProblems": "onProblem", + "close": true, "clear": true }, "options": { @@ -109,16 +125,18 @@ "cwd": "${workspaceFolder}/extensions/vscode" } }, - // Install or update all dependencies for all projects in the monrepo { "label": "install-all-dependencies", "type": "shell", "windows": { "command": "./scripts/install-dependencies.ps1" }, "command": "./scripts/install-dependencies.sh", - "problemMatcher": [] // Empty so users are not prompted to select progress reporting + "problemMatcher": [], + "presentation": { + "group": "maintenance", + "panel": "shared", + "reveal": "always" + } }, - // - // Start the React App for debugging with Vite { "label": "gui:dev", "type": "shell", @@ -128,6 +146,16 @@ }, "args": ["run", "dev"], "isBackground": true, + "runOptions": { + "instanceLimit": 1 + }, + "presentation": { + "group": "dev-watchers", + "panel": "dedicated", + "reveal": "always", + "focus": false, + "showReuseMessage": false + }, "problemMatcher": [ { "pattern": [ @@ -146,14 +174,17 @@ } ] }, - // - // esbuild for the core binary { "label": "binary:esbuild", "type": "shell", "command": "npm", "args": ["run", "esbuild"], "problemMatcher": [], + "presentation": { + "group": "build-tasks", + "panel": "shared", + "reveal": "always" + }, "options": { "cwd": "binary" } @@ -164,6 +195,11 @@ "command": "npm", "args": ["run", "start", "--", "--no-open"], "problemMatcher": [], + "presentation": { + "group": "docs", + "panel": "dedicated", + "reveal": "always" + }, "options": { "cwd": "docs" } @@ -173,7 +209,12 @@ "type": "shell", "command": "node", "args": ["${workspaceFolder}/scripts/uninstall.js"], - "problemMatcher": [] + "problemMatcher": [], + "presentation": { + "group": "maintenance", + "panel": "shared", + "reveal": "always" + } }, { "label": "refresh-dependencies:core", @@ -185,6 +226,9 @@ "cwd": "${workspaceFolder}/core" }, "presentation": { + "group": "maintenance", + "panel": "shared", + "reveal": "silent", "close": true } }, @@ -198,6 +242,9 @@ "cwd": "${workspaceFolder}/extensions/vscode" }, "presentation": { + "group": "maintenance", + "panel": "shared", + "reveal": "silent", "close": true } }, @@ -211,6 +258,9 @@ "cwd": "${workspaceFolder}/gui" }, "presentation": { + "group": "maintenance", + "panel": "shared", + "reveal": "silent", "close": true } }, @@ -222,35 +272,45 @@ "refresh-dependencies:vscode" ], "type": "shell", - "problemMatcher": [] + "problemMatcher": [], + "presentation": { + "group": "maintenance", + "panel": "shared", + "reveal": "always" + } }, { - "label": "Build Continue packages", + "label": "continue-packages:build", "type": "shell", "command": "node ./scripts/build-packages.js", - "isBackground": true, - "problemMatcher": { - "pattern": { - "regexp": "__DUMMY_PATTERN_THAT_NEVER_MATCHES__", - "file": 1 - }, - "background": { - "activeOnStart": true, - "beginsPattern": ".", - "endsPattern": "." - } - }, + "problemMatcher": [], "presentation": { - "reveal": "silent", - "panel": "shared" + "group": "build-tasks", + "panel": "shared", + "reveal": "always", + "close": true, + "revealProblems": "onProblem" } }, { "label": "vscode-extension:build-with-packages", - // "dependsOn": ["vscode-extension:build"], - "dependsOn": ["Build Continue packages", "vscode-extension:build"], + "dependsOn": ["continue-packages:build", "vscode-extension:build"], "type": "shell", - "problemMatcher": [] + "command": "echo", + "args": ["Build with packages completed"], + "problemMatcher": [], + "dependsOrder": "sequence", + "runOptions": { + "instanceLimit": 1, + "reevaluateOnRerun": true + }, + "presentation": { + "group": "build-tasks", + "panel": "shared", + "reveal": "silent", + "close": true, + "focus": false + } } ] } diff --git a/extensions/vscode/e2e/tests/PromptFile.test.ts b/extensions/vscode/e2e/tests/PromptFile.test.ts index 7cf87fd54..2717fd17e 100644 --- a/extensions/vscode/e2e/tests/PromptFile.test.ts +++ b/extensions/vscode/e2e/tests/PromptFile.test.ts @@ -42,11 +42,25 @@ describe("Prompt file", () => { "terminal", "tree", ]; + for (const provider of providers) { - await editor.typeText("@" + provider.slice(0, 2)); - await editor.typeText(Key.ENTER); + // Type the @ symbol to trigger completion + await editor.typeText("@"); + + // Wait a moment for the completion to appear + await new Promise((resolve) => setTimeout(resolve, 500)); + + // Type the first few characters + await editor.typeText(provider.slice(0, 2)); + + // Wait for completion popup to update + await new Promise((resolve) => setTimeout(resolve, 300)); + + // Use Tab to accept completion instead of Enter + await editor.typeText(Key.TAB); + const text = await editor.getText(); - expect(text).equals("@" + provider); + expect(text).to.include("@" + provider); await editor.clearText(); } diff --git a/extensions/vscode/scripts/prepackage.js b/extensions/vscode/scripts/prepackage.js index 802a4eb4f..29dbf2e8e 100644 --- a/extensions/vscode/scripts/prepackage.js +++ b/extensions/vscode/scripts/prepackage.js @@ -55,8 +55,6 @@ console.log("[info] Using target: ", target); const exe = os === "win32" ? ".exe" : ""; -const isInGitHubAction = !!process.env.GITHUB_ACTIONS; - const isArmTarget = target === "darwin-arm64" || target === "linux-arm64" || @@ -86,15 +84,6 @@ void (async () => { process.chdir(path.join(continueDir, "gui")); - if (isInGitHubAction) { - const guiBuildStart = Date.now(); - console.log(`[timer] Starting GUI build at ${new Date().toISOString()}`); - execCmdSync("npm run build"); - console.log( - `[timer] GUI build completed in ${Date.now() - guiBuildStart}ms`, - ); - } - // Copy over the dist folder to the JetBrains extension // const intellijExtensionWebviewPath = path.join( "..", @@ -140,6 +129,7 @@ void (async () => { // Then copy over the dist folder to the VSCode extension // const vscodeGuiPath = path.join("../extensions/vscode/gui"); + rimrafSync(vscodeGuiPath); fs.mkdirSync(vscodeGuiPath, { recursive: true }); const vscodeCopyStart = Date.now(); console.log(`[timer] Starting VSCode copy at ${new Date().toISOString()}`); diff --git a/scripts/build-packages.js b/scripts/build-packages.js index 238a8f0ea..996323f8a 100644 --- a/scripts/build-packages.js +++ b/scripts/build-packages.js @@ -86,7 +86,7 @@ async function main() { await buildPackagesInParallel(["fetch", "config-yaml", "llm-info"]); // Phase 3: Build packages that depend on other local packages - await buildPackagesInParallel(["openai-adapters", "continue-sdk"], true); + await buildPackagesInParallel(["openai-adapters", "continue-sdk"]); console.log("🎉 All packages built successfully!"); } catch (error) {