-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bc3a420
commit a752392
Showing
11 changed files
with
212 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
on: | ||
push: | ||
tags: | ||
- "v*" | ||
|
||
jobs: | ||
homebrew: | ||
name: Release Zed Extension | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: huacnlee/zed-extension-action@v1 | ||
with: | ||
extension-name: pact | ||
# extension-path: extensions/${{ extension-name }} | ||
push-to: salamaashoush/extensions | ||
env: | ||
# the personal access token should have "repo" & "workflow" scopes | ||
COMMITTER_TOKEN: ${{ secrets.COMMITTER_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
4.11 | ||
nightly |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
[package] | ||
name = "pact-lang-zed-extension" | ||
version = "0.0.2" | ||
version = "0.0.3" | ||
edition = "2021" | ||
|
||
[lib] | ||
crate-type = ["cdylib"] | ||
|
||
[dependencies] | ||
zed_extension_api = { git = "https://github.com/zed-industries/zed" } | ||
zed_extension_api = "0.2.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,117 @@ | ||
# pact-zed | ||
# Pact for Zed | ||
|
||
Pact Programming Language extension for [Zed](https://github.com/zed-industries/zed) | ||
A zed extension that brings full Pact language support to the [Zed](https://github.com/zed-industries/zed) editor. | ||
|
||
## Features | ||
## ✨ Features | ||
|
||
- Syntax highlighting | ||
- Outline view | ||
- Code folding | ||
- Tasks for running pact files/tests | ||
- LSP support for autocompletion, diagnostics, hover docs, go to defintion and more | ||
- 🎨 Syntax highlighting | ||
- 📑 Smart outline view for quick navigation | ||
- 📦 Code folding | ||
- ⚡️ Built-in tasks for running Pact files and tests | ||
- 🚀 Intelligent code assistance: | ||
- Auto-completion | ||
- Real-time error checking | ||
- Hover documentation | ||
- Go to definition | ||
- And more! | ||
|
||
## Test locally | ||
## 🚀 Getting Started | ||
|
||
- Clone this repo: `git clone https://github.com/kadena-community/pact-zed` | ||
- Open Zed | ||
- Go to `Settings` -> `Extensions` -> Click the `Install Dev Extension` and select the `pact-zed` folder | ||
### Option 1: Using Pactup (Recommended) | ||
|
||
Pactup is the easiest way to manage your Pact installation: | ||
|
||
follow the instructions to install Pactup: https://github.com/kadena-community/pactup then run the following commands: | ||
|
||
```bash | ||
# Install the latest nightly build | ||
pactup install nightly --force | ||
|
||
# Set it as your active version | ||
pactup use nightly | ||
``` | ||
|
||
Quick one-liner (no installation required): | ||
|
||
```bash | ||
npx pactup install nightly --force && npx pactup which nightly | ||
# /home/salama/.local/share/pactup/pact-versions/nightly | ||
``` | ||
|
||
Copy the path to the pact installation and append `/bin/pact` then paste it in your Zed settings | ||
|
||
```json | ||
{ | ||
"lsp": { | ||
"pact": { | ||
"path": "/home/salama/.local/share/pactup/pact-versions/nightly/bin/pact", | ||
"arguments": ["--lsp"] | ||
} | ||
} | ||
} | ||
``` | ||
|
||
### Option 2: Manual Configuration | ||
|
||
You can specify a custom Pact binary in your Zed settings: | ||
|
||
1. Open Zed Settings | ||
2. Add the following configuration: | ||
|
||
```json | ||
{ | ||
"lsp": { | ||
"pact": { | ||
"path": "/path/to/your/pact", | ||
"arguments": ["--lsp"] | ||
} | ||
} | ||
} | ||
``` | ||
|
||
## 🔍 How It Works | ||
|
||
The extension will look for a Pact binary in this order: | ||
|
||
1. System PATH | ||
2. Custom path specified in Zed settings | ||
3. Automatically downloaded nightly build (cached for future use) | ||
|
||
> 💡 **Tip**: Using Pactup is recommended as it helps you manage and update your Pact installation easily. | ||
## 🔄 Keeping Pact Updated | ||
|
||
To update to the latest nightly build: | ||
|
||
```bash | ||
pactup install nightly --force | ||
pactup use nightly | ||
``` | ||
|
||
You can also specify a Pact version for your project by creating a `.pact-version` file in your project root: | ||
|
||
``` | ||
nightly | ||
``` | ||
|
||
## 🛠️ Development | ||
|
||
Want to contribute? Here's how to set up the extension locally: | ||
|
||
1. Clone the repository: | ||
|
||
```bash | ||
git clone https://github.com/kadena-community/pact-zed | ||
``` | ||
|
||
2. Open Zed | ||
3. Go to `Settings` → `Extensions` | ||
4. Click `Install Dev Extension` and select the `pact-zed` folder | ||
|
||
## 🤝 Contributing | ||
|
||
Contributions are welcome! Feel free to: | ||
|
||
- Open issues for bugs or feature requests | ||
- Submit pull requests | ||
- Share feedback |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
id = "pact" | ||
name = "PactLang" | ||
version = "0.0.2" | ||
version = "0.0.3" | ||
schema_version = 1 | ||
authors = ["Salama Ashoush <[email protected]>"] | ||
description = "Pact Programming Language extension for Zed" | ||
repository = "https://github.com/kadena-community/pact-zed" | ||
|
||
[grammars.pact] | ||
repository = "https://github.com/kadena-community/tree-sitter-pact" | ||
commit = "991b8e45b5455b516da51baa44bfe0a50a8464bb" | ||
commit = "6e94b4d1fc720ea7b53015aa14499618cd92e02a" | ||
|
||
[language_servers.pact] | ||
name = "Pact Language Server" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.