diff --git a/.github/workflows/release_vscode.yml b/.github/workflows/release_vscode.yml index adeaa0b9f..34fb45c66 100644 --- a/.github/workflows/release_vscode.yml +++ b/.github/workflows/release_vscode.yml @@ -117,13 +117,13 @@ jobs: - name: Package Extension working-directory: editors/vscode - run: pnpm exec vsce package -o "../../oxc_lsp-${{ matrix.code-target }}.vsix" --target ${{ matrix.code-target }} + run: pnpm exec vsce package -o "../../oxc_vscode-${{ matrix.code-target }}.vsix" --target ${{ matrix.code-target }} - name: Upload VSCode extension artifact uses: actions/upload-artifact@v3 with: name: vscode_packages - path: ./oxc_lsp-${{ matrix.code-target }}.vsix + path: ./oxc_vscode-${{ matrix.code-target }}.vsix if-no-files-found: error publish: @@ -159,6 +159,6 @@ jobs: - name: Publish extension to Microsoft Marketplace working-directory: editors/vscode - run: pnpm exec vsce publish --packagePath oxc_lsp-*.vsix + run: pnpm exec vsce publish --packagePath oxc_vscode-*.vsix env: VSCE_PAT: ${{ secrets.VSCE_PERSONAL_ACCESS_TOKEN }} diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 96afa5e1c..f9b86806a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -68,9 +68,8 @@ Build the extension and run it inside vscode: 1. `pnpm install` 2. `pnpm run build` -3. `pnpm run package` 4. open vscode and run the command palette "Extensions: Install from VSIX..." -5. find the `oxc-vscode-x.x.x.vsix` file from `./editors/vscode` directory +5. find the `oxc-vscode.vsix` file from `./editors/vscode` directory 6. open a `.js` / `.ts` file, add `debugger;` and save 7. see the warning `eslint(no-debugger): debugger statement is not allowed - oxc` diff --git a/editors/vscode/client/extension.ts b/editors/vscode/client/extension.ts index 1be6a0cfa..debbb853f 100644 --- a/editors/vscode/client/extension.ts +++ b/editors/vscode/client/extension.ts @@ -69,10 +69,8 @@ export async function activate(context: ExtensionContext) { const traceOutputChannel = window.createOutputChannel(traceOutputChannelName); const ext = process.platform === "win32" ? ".exe" : ""; - let serverPath = process.env.SERVER_PATH_DEV ?? `oxc_vscode${ext}`; - const command = join(serverPath); - - // window.showInformationMessage(`oxc server path: ${command}`); + // NOTE: The `./target/release` path is aligned with the path defined in .github/workflows/release_vscode.yml + const command = process.env.SERVER_PATH_DEV ?? join(context.extensionPath, `./target/release/oxc_vscode${ext}`); const run: Executable = { command: command!, diff --git a/editors/vscode/package.json b/editors/vscode/package.json index ab69ccba7..b3289b3aa 100644 --- a/editors/vscode/package.json +++ b/editors/vscode/package.json @@ -81,8 +81,8 @@ "build": "pnpm run server:build:release && pnpm run compile && pnpm run package", "compile": "esbuild client/extension.ts --bundle --outfile=out/main.js --external:vscode --format=cjs --platform=node --target=node16 --minify", "watch": "pnpm run compile --watch", - "package": "vsce package --no-dependencies -o oxc_lsp.vsix", - "install-extension": "code --install-extension oxc_lsp.vsix --force", + "package": "vsce package --no-dependencies -o oxc_vscode.vsix", + "install-extension": "code --install-extension oxc_vscode.vsix --force", "server:build:debug": "cargo build -p oxc_vscode", "server:build:release": "cross-env CARGO_TARGET_DIR=./target cargo build -p oxc_vscode --release" },