Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Create Zed Editor extension #1421

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@ jobs:

- run: npm test -- --forbid-only

#- run: npm run lint
# - run: npm run lint

- run: npm run release

# - name: Release Zed Extension
# uses: huacnlee/zed-extension-action@v1
# with:
# extension-name: spyglass
# push-to: SpyglassMC/zed-extensions
# env:
# COMMITTER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4 changes: 4 additions & 0 deletions packages/zed-extension/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/target
grammars/
*.wasm
.DS_Store
322 changes: 322 additions & 0 deletions packages/zed-extension/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions packages/zed-extension/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[package]
name = "zed-spyglass"
version = "0.1.0"
edition = "2021"

[lib]
crate-type = ["cdylib"]

[dependencies]
zed_extension_api = "^0.0.6"
12 changes: 12 additions & 0 deletions packages/zed-extension/DEVELOPMENT
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Development Guide

You must install [zed-extension](https://github.com/zed-industries/zed/tree/main/crates/extension_cli) cli first.

hello你好

## Release

1. Update the version in `Cargo.toml` and `extension.toml`.
2. Commit with message `Release vX.Y.Z`.
3. Create git tag `vX.Y.Z` and push.
4. Then GitHub Actions will automatically create a release PR to [zed-extensions](https://github.com/zed-industries/extensions/pulls).
6 changes: 6 additions & 0 deletions packages/zed-extension/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
build:
mkdir -p target/spyglass
zed-extension --source-dir ./ --output-dir ./target/ --scratch-dir ./target
tar -xzf target/archive.tar.gz -C target/spyglass
cp -Rf target/spyglass ~/Library/Application\ Support/Zed/extensions/installed/
tree ~/Library/Application\ Support/Zed/extensions/installed/spyglass
17 changes: 17 additions & 0 deletions packages/zed-extension/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Spyglass for Zed

[Spyglass](https://github.com/SpyglassMC/Spyglass) provides heavy language features for Minecraft: Java Edition data pack files.

Based on the Spyglass LSP, you can use it to check and fix your text in real-time.

## Features

- Automatically downloads Spyglass.

## Installation

Open `Extensions` on your Zed, search for `Spyglass` and click on `Install`.

## License

Credit to Jason Lee's [zed-autocorrect](https://github.com/huacnlee/zed-autocorrect) extension providing an example implementation.
Loading
Loading