fix(vscode): fix the broken package path

This commit is contained in:
Boshen 2023-12-08 21:19:00 +08:00
parent 19e9f6a3a3
commit e2d5763d22
No known key found for this signature in database
GPG key ID: 234DA6A7079C6801
4 changed files with 8 additions and 11 deletions

View file

@ -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 }}

View file

@ -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`

View file

@ -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!,

View file

@ -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"
},