Skip to content

Commit fa58de0

Browse files
committed
chore(editors): drop VSCode publish CI + extract Zed extension
Replace .github/workflows/vscode.yml (multi-platform package + publish matrix) with `make vscode-vsix` and `make vscode-vsix-target` targets that build a VSIX locally — the maintainer uploads to the marketplace manually now, so the CI matrix and PAT secrets weren't earning their keep. Move editors/zed/ out into its own repo at davidsmfreire/sqlshield-zed. Zed extensions are submitted to zed-industries/extensions as submodule pointers, which expects a dedicated repo. Update README to point at the new location.
1 parent e5d6a27 commit fa58de0

10 files changed

Lines changed: 68 additions & 1236 deletions

File tree

.github/workflows/vscode.yml

Lines changed: 0 additions & 139 deletions
This file was deleted.

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
11
.venv
22
/target
33
**/target/
4+
/dist
45
.vscode
56

7+
# Local VSIX build artifacts (see `make vscode-vsix`)
8+
editors/vscode/server/
9+
editors/vscode/out/
10+
editors/vscode/node_modules/
11+
editors/vscode/*.vsix
12+
613
# Python
714
__pycache__/
815
*.py[cod]
@@ -18,3 +25,4 @@ Thumbs.db
1825
# Env
1926
.env
2027
.env.local
28+
post.txt

Cargo.toml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@ members = [
77
"sqlshield-lsp",
88
"sqlshield-py",
99
]
10-
# editors/zed targets wasm32-wasip1 and uses zed_extension_api; keep
11-
# it out of the main workspace so it doesn't interfere with normal
12-
# cargo build/test/clippy commands.
13-
exclude = ["editors/zed"]
1410
# Root `sqlshield-precommit` package is a pre-commit shim; exclude from
1511
# default builds so it doesn't clobber sqlshield-cli's `sqlshield` bin.
1612
default-members = [

Makefile

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,59 @@ all: clean dev-setup build test
3737
clean:
3838
rm -rf .venv && \
3939
cargo clean
40+
41+
# --- VS Code extension --------------------------------------------------
42+
#
43+
# Build the VSIX locally. By default it bundles the sqlshield-lsp binary
44+
# for the host platform only; `vscode-vsix-target TARGET=…` builds for
45+
# any target rustc can hit (cross-compiling toolchain must already be
46+
# installed). The marketplace `--target` is inferred from TARGET.
47+
48+
VSCODE_DIR := editors/vscode
49+
DIST_DIR := dist
50+
51+
# Host (no --target): produce a generic, untargeted VSIX. Fine for `code
52+
# --install-extension` on whatever machine you run this on.
53+
vscode-vsix:
54+
cargo build -p sqlshield-lsp --release
55+
mkdir -p $(VSCODE_DIR)/server
56+
cp target/release/sqlshield-lsp $(VSCODE_DIR)/server/sqlshield-lsp
57+
chmod +x $(VSCODE_DIR)/server/sqlshield-lsp
58+
cd $(VSCODE_DIR) && npm ci && npm run compile
59+
mkdir -p $(DIST_DIR)
60+
cd $(VSCODE_DIR) && npx --yes @vscode/vsce package \
61+
--out ../../$(DIST_DIR)/sqlshield-host.vsix
62+
63+
# Cross-targeted build. Example:
64+
# make vscode-vsix-target TARGET=aarch64-apple-darwin VSCE_TARGET=darwin-arm64
65+
# Maps:
66+
# x86_64-unknown-linux-gnu -> linux-x64
67+
# aarch64-unknown-linux-gnu -> linux-arm64
68+
# x86_64-apple-darwin -> darwin-x64
69+
# aarch64-apple-darwin -> darwin-arm64
70+
# x86_64-pc-windows-msvc -> win32-x64
71+
# aarch64-pc-windows-msvc -> win32-arm64
72+
vscode-vsix-target:
73+
@if [ -z "$(TARGET)" ] || [ -z "$(VSCE_TARGET)" ]; then \
74+
echo "TARGET= and VSCE_TARGET= are required"; exit 1; \
75+
fi
76+
rustup target add $(TARGET)
77+
cargo build -p sqlshield-lsp --release --target $(TARGET)
78+
mkdir -p $(VSCODE_DIR)/server
79+
@if [ "$(VSCE_TARGET)" = "win32-x64" ] || [ "$(VSCE_TARGET)" = "win32-arm64" ]; then \
80+
cp target/$(TARGET)/release/sqlshield-lsp.exe $(VSCODE_DIR)/server/sqlshield-lsp.exe; \
81+
else \
82+
cp target/$(TARGET)/release/sqlshield-lsp $(VSCODE_DIR)/server/sqlshield-lsp; \
83+
chmod +x $(VSCODE_DIR)/server/sqlshield-lsp; \
84+
fi
85+
cd $(VSCODE_DIR) && npm ci && npm run compile
86+
mkdir -p $(DIST_DIR)
87+
cd $(VSCODE_DIR) && npx --yes @vscode/vsce package \
88+
--target $(VSCE_TARGET) \
89+
--out ../../$(DIST_DIR)/sqlshield-$(VSCE_TARGET).vsix
90+
91+
vscode-clean:
92+
rm -rf $(VSCODE_DIR)/server $(VSCODE_DIR)/out $(DIST_DIR)
93+
94+
.PHONY: hooks venv deps develop dev-setup build test all clean \
95+
vscode-vsix vscode-vsix-target vscode-clean

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,10 @@ A first-party VS Code extension lives at
154154
[`editors/vscode/`](editors/vscode/README.md) — it spawns `sqlshield-lsp`
155155
over stdio and forwards diagnostics as you type.
156156

157+
A Zed extension is published separately at
158+
[`davidsmfreire/sqlshield-zed`](https://github.com/davidsmfreire/sqlshield-zed)
159+
and wraps the same `sqlshield-lsp` binary.
160+
157161
## pre-commit
158162

159163
sqlshield ships a [pre-commit](https://pre-commit.com/) hook so it can

0 commit comments

Comments
 (0)