mirror of
https://github.com/danbulant/oxc
synced 2026-05-25 12:51:57 +00:00
fix(vscode): fix the broken package path
This commit is contained in:
parent
19e9f6a3a3
commit
e2d5763d22
4 changed files with 8 additions and 11 deletions
6
.github/workflows/release_vscode.yml
vendored
6
.github/workflows/release_vscode.yml
vendored
|
|
@ -117,13 +117,13 @@ jobs:
|
||||||
|
|
||||||
- name: Package Extension
|
- name: Package Extension
|
||||||
working-directory: editors/vscode
|
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
|
- name: Upload VSCode extension artifact
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: vscode_packages
|
name: vscode_packages
|
||||||
path: ./oxc_lsp-${{ matrix.code-target }}.vsix
|
path: ./oxc_vscode-${{ matrix.code-target }}.vsix
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
|
|
||||||
publish:
|
publish:
|
||||||
|
|
@ -159,6 +159,6 @@ jobs:
|
||||||
|
|
||||||
- name: Publish extension to Microsoft Marketplace
|
- name: Publish extension to Microsoft Marketplace
|
||||||
working-directory: editors/vscode
|
working-directory: editors/vscode
|
||||||
run: pnpm exec vsce publish --packagePath oxc_lsp-*.vsix
|
run: pnpm exec vsce publish --packagePath oxc_vscode-*.vsix
|
||||||
env:
|
env:
|
||||||
VSCE_PAT: ${{ secrets.VSCE_PERSONAL_ACCESS_TOKEN }}
|
VSCE_PAT: ${{ secrets.VSCE_PERSONAL_ACCESS_TOKEN }}
|
||||||
|
|
|
||||||
|
|
@ -68,9 +68,8 @@ Build the extension and run it inside vscode:
|
||||||
|
|
||||||
1. `pnpm install`
|
1. `pnpm install`
|
||||||
2. `pnpm run build`
|
2. `pnpm run build`
|
||||||
3. `pnpm run package`
|
|
||||||
4. open vscode and run the command palette "Extensions: Install from VSIX..."
|
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
|
6. open a `.js` / `.ts` file, add `debugger;` and save
|
||||||
7. see the warning `eslint(no-debugger): debugger statement is not allowed - oxc`
|
7. see the warning `eslint(no-debugger): debugger statement is not allowed - oxc`
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -69,10 +69,8 @@ export async function activate(context: ExtensionContext) {
|
||||||
const traceOutputChannel = window.createOutputChannel(traceOutputChannelName);
|
const traceOutputChannel = window.createOutputChannel(traceOutputChannelName);
|
||||||
|
|
||||||
const ext = process.platform === "win32" ? ".exe" : "";
|
const ext = process.platform === "win32" ? ".exe" : "";
|
||||||
let serverPath = process.env.SERVER_PATH_DEV ?? `oxc_vscode${ext}`;
|
// NOTE: The `./target/release` path is aligned with the path defined in .github/workflows/release_vscode.yml
|
||||||
const command = join(serverPath);
|
const command = process.env.SERVER_PATH_DEV ?? join(context.extensionPath, `./target/release/oxc_vscode${ext}`);
|
||||||
|
|
||||||
// window.showInformationMessage(`oxc server path: ${command}`);
|
|
||||||
|
|
||||||
const run: Executable = {
|
const run: Executable = {
|
||||||
command: command!,
|
command: command!,
|
||||||
|
|
|
||||||
|
|
@ -81,8 +81,8 @@
|
||||||
"build": "pnpm run server:build:release && pnpm run compile && pnpm run package",
|
"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",
|
"compile": "esbuild client/extension.ts --bundle --outfile=out/main.js --external:vscode --format=cjs --platform=node --target=node16 --minify",
|
||||||
"watch": "pnpm run compile --watch",
|
"watch": "pnpm run compile --watch",
|
||||||
"package": "vsce package --no-dependencies -o oxc_lsp.vsix",
|
"package": "vsce package --no-dependencies -o oxc_vscode.vsix",
|
||||||
"install-extension": "code --install-extension oxc_lsp.vsix --force",
|
"install-extension": "code --install-extension oxc_vscode.vsix --force",
|
||||||
"server:build:debug": "cargo build -p oxc_vscode",
|
"server:build:debug": "cargo build -p oxc_vscode",
|
||||||
"server:build:release": "cross-env CARGO_TARGET_DIR=./target cargo build -p oxc_vscode --release"
|
"server:build:release": "cross-env CARGO_TARGET_DIR=./target cargo build -p oxc_vscode --release"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue