diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ee2efd21..b298172d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,42 +5,196 @@ on: branches: ['master'] pull_request: branches: ['master'] + workflow_dispatch: -jobs: - test: - runs-on: ubuntu-22.04 +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true +jobs: + lint: + runs-on: ubuntu-24.04 + timeout-minutes: 5 steps: - name: Checkout uses: actions/checkout@v4 - name: Setup Bun - uses: oven-sh/setup-bun@v1 + uses: oven-sh/setup-bun@v2 with: bun-version: latest + - name: Cache Bun dependencies + uses: actions/cache@v4 + with: + path: ~/.bun/install/cache + key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lock') }} + restore-keys: | + ${{ runner.os }}-bun- + - name: Install Dependencies run: | cd language-server && bun install --frozen-lockfile cd ../vscode-extension && bun install --frozen-lockfile - - name: Install Linux Dependencies - run: | - sudo apt-get update - sudo apt-get install -y xvfb libasound2 libatk1.0-0 libgbm1 libgtk-3-0 libnss3 libxkbfile1 libxss1 + - name: Lint Language Server + working-directory: language-server + run: bun run lint + + - name: Lint VS Code Extension + working-directory: vscode-extension + run: bun run lint + + test-language-server: + runs-on: ubuntu-24.04 + needs: lint + timeout-minutes: 10 + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Bun + uses: oven-sh/setup-bun@v2 + with: + bun-version: latest + + - name: Cache Bun dependencies + uses: actions/cache@v4 + with: + path: ~/.bun/install/cache + key: ${{ runner.os }}-bun-ls-${{ hashFiles('language-server/bun.lock') }} + restore-keys: | + ${{ runner.os }}-bun-ls- + + - name: Install Dependencies + working-directory: language-server + run: bun install --frozen-lockfile - name: Run Language Server Tests working-directory: language-server - run: bun run test + run: | + bun run build + bun run test + + - name: Upload Language Server Artifact + uses: actions/upload-artifact@v4 + with: + name: language-server-dist + path: language-server/dist + retention-days: 1 + + test-vscode-extension: + runs-on: ubuntu-24.04 + needs: [lint, test-language-server] + timeout-minutes: 15 + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Bun + uses: oven-sh/setup-bun@v2 + with: + bun-version: latest + + - name: Cache Bun dependencies + uses: actions/cache@v4 + with: + path: ~/.bun/install/cache + key: ${{ runner.os }}-bun-vscode-${{ hashFiles('vscode-extension/bun.lock', 'language-server/bun.lock') }} + restore-keys: | + ${{ runner.os }}-bun-vscode- + + - name: Install Dependencies + run: | + cd language-server && bun install --frozen-lockfile + cd ../vscode-extension && bun install --frozen-lockfile + + - name: Download Language Server Artifact + uses: actions/download-artifact@v4 + with: + name: language-server-dist + path: language-server/dist + + - name: Cache VS Code Binary + uses: actions/cache@v4 + with: + path: vscode-extension/.vscode-test + key: ${{ runner.os }}-vscode-${{ hashFiles('vscode-extension/package.json') }} + restore-keys: | + ${{ runner.os }}-vscode- + + - name: Install Linux Dependencies + run: | + sudo apt-get update -yq + sudo apt-get install -yq --no-install-recommends xvfb libasound2t64 libatk1.0-0t64 libgbm1 libgtk-3-0t64 libnss3 libxkbfile1 libxss1 - name: Run VS Code Extension Tests working-directory: vscode-extension - run: xvfb-run -a bun run test + run: | + bun run esbuild + bun run scripts/copy-artifacts.ts + bun x tsc -p . + xvfb-run -a node ./out/vscode-extension/src/test/runTest.js + env: + DBUS_SESSION_BUS_ADDRESS: /dev/null + + benchmarks: + runs-on: ubuntu-24.04 + needs: [lint, test-language-server, test-vscode-extension] + timeout-minutes: 20 + if: | + (github.event_name == 'push' && github.ref == 'refs/heads/master') || + github.event_name == 'workflow_dispatch' + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Bun + uses: oven-sh/setup-bun@v2 + with: + bun-version: latest + + - name: Cache Bun dependencies + uses: actions/cache@v4 + with: + path: ~/.bun/install/cache + key: ${{ runner.os }}-bun-bench-${{ hashFiles('language-server/bun.lock', 'vscode-extension/bun.lock') }} + restore-keys: | + ${{ runner.os }}-bun-bench- + + - name: Install Dependencies + run: | + cd language-server && bun install --frozen-lockfile + cd ../vscode-extension && bun install --frozen-lockfile + + - name: Download Language Server Artifact + uses: actions/download-artifact@v4 + with: + name: language-server-dist + path: language-server/dist + + - name: Cache VS Code Binary + uses: actions/cache@v4 + with: + path: vscode-extension/.vscode-test + key: ${{ runner.os }}-vscode-bench-${{ hashFiles('vscode-extension/package.json') }} + restore-keys: | + ${{ runner.os }}-vscode-bench- + + - name: Install Linux Dependencies (for extension benchmarks) + run: | + sudo apt-get update -yq + sudo apt-get install -yq --no-install-recommends xvfb libasound2t64 libatk1.0-0t64 libgbm1 libgtk-3-0t64 libnss3 libxkbfile1 libxss1 - name: Run Benchmarks run: | chmod +x run_benchmarks.sh ./run_benchmarks.sh + env: + DBUS_SESSION_BUS_ADDRESS: /dev/null - name: Upload Benchmark Report if: always() @@ -49,7 +203,7 @@ jobs: cat benchmark_report.md >> $GITHUB_STEP_SUMMARY fi - - name: Upload Benchmark Report + - name: Upload Benchmark Artifact if: always() uses: actions/upload-artifact@v4 with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 78d5b4c2..6ab65d91 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -15,10 +15,18 @@ jobs: uses: actions/checkout@v4 - name: Setup Bun - uses: oven-sh/setup-bun@v1 + uses: oven-sh/setup-bun@v2 with: bun-version: latest + - name: Cache Bun dependencies + uses: actions/cache@v4 + with: + path: ~/.bun/install/cache + key: ${{ runner.os }}-bun-release-${{ hashFiles('language-server/bun.lock', 'vscode-extension/bun.lock') }} + restore-keys: | + ${{ runner.os }}-bun-release- + - name: Extract version from tag id: get_version run: echo "VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_OUTPUT diff --git a/.github/workflows/vs-release.yml b/.github/workflows/vs-release.yml index 3e557639..6fdad0b9 100644 --- a/.github/workflows/vs-release.yml +++ b/.github/workflows/vs-release.yml @@ -21,10 +21,18 @@ jobs: dotnet-version: '8.0.x' - name: Setup Bun - uses: oven-sh/setup-bun@v1 + uses: oven-sh/setup-bun@v2 with: bun-version: latest + - name: Cache Bun dependencies + uses: actions/cache@v4 + with: + path: ~/.bun/install/cache + key: ${{ runner.os }}-bun-vs-release-${{ hashFiles('language-server/bun.lock', 'vscode-extension/bun.lock') }} + restore-keys: | + ${{ runner.os }}-bun-vs-release- + - name: Add MSBuild to PATH uses: microsoft/setup-msbuild@v1.0.2 diff --git a/.jules/palette.md b/.jules/palette.md index 71303584..f1889d19 100644 --- a/.jules/palette.md +++ b/.jules/palette.md @@ -1,7 +1,6 @@ - ## 2024-05-24 - Empty States Should Be Actionable **Learning:** Users often get stuck in empty search states because the path to recovery (clearing text or changing tabs) requires moving focus away from the empty state area. **Action:** Always provide an actionable recovery path (like a "Clear Search" button) directly within the empty state container to reduce interaction friction. ## 2024-11-20 - Dynamic Accessibility for Multi-Scope Inputs **Learning:** In multi-scope UI elements (like a unified search bar that filters based on context), static ARIA labels or `AutomationProperties.Name` attributes (e.g., "Search query") fail to convey the current state to screen reader users. The context of *what* is being searched is crucial for accessibility. -**Action:** Always bind the accessibility name (e.g., `AutomationProperties.Name` in WPF/XAML) to the dynamic placeholder property rather than a generic static string. This ensures screen readers announce context-aware hints (like "Classes: Try 'UserService'...") when the user switches scopes. +**Action:** Always bind the accessibility name (e.g., `AutomationProperties.Name="{Binding SearchPlaceholder}"`) to the dynamic placeholder property rather than a generic static string. This ensures screen readers announce context-aware hints (like "Classes: Try 'UserService'...") when the user switches scopes, and that the screen reader context matches the visual tooltip. diff --git a/vscode-extension/src/test/runTest.ts b/vscode-extension/src/test/runTest.ts index 4d6ebde9..cc747dbc 100644 --- a/vscode-extension/src/test/runTest.ts +++ b/vscode-extension/src/test/runTest.ts @@ -10,7 +10,7 @@ import * as path from 'node:path'; await runTests({ extensionDevelopmentPath, extensionTestsPath, - launchArgs: [workspacePath, '--no-sandbox', '--disable-gpu', '--headless'], + launchArgs: [workspacePath, '--no-sandbox', '--disable-gpu'], timeout: 120_000, }).catch((err) => { console.error('Failed to run tests', err);