-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
make this repository usable as Zig dependency for other projects
- Loading branch information
Showing
6 changed files
with
14,928 additions
and
25 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,44 @@ | ||
name: Deploy autodoc to Github Pages | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
|
||
concurrency: | ||
group: "pages" | ||
cancel-in-progress: false | ||
|
||
jobs: | ||
deploy: | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Pages | ||
uses: actions/configure-pages@v5 | ||
|
||
- name: Setup Zig | ||
uses: goto-bus-stop/setup-zig@v2 | ||
with: | ||
version: master | ||
|
||
- run: zig build docs --summary all | ||
|
||
- name: Upload artifact | ||
uses: actions/upload-pages-artifact@v3 | ||
with: | ||
path: "zig-out/doc/lsp-codegen" | ||
|
||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v4 |
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,5 +1,4 @@ | ||
.zig-cache | ||
zig-out | ||
metaModel.json | ||
|
||
zig-cache |
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,24 @@ | ||
# zig-lsp-codegen | ||
[![CI](https://github.com/zigtools/zig-lsp-codegen/actions/workflows/main.yml/badge.svg)](https://github.com/zigtools/zig-lsp-codegen/actions) | ||
[![Documentation](https://badgen.net/badge/icon/Docs?icon=wiki&label)](https://zigtools.github.io/zig-lsp-codegen) | ||
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) | ||
|
||
Zig LSP codegen from the newly released, official metamodel! This actually good code replaces the much hackier [lsp-typegen](https://github.com/zigtools/lsp-typegen); | ||
# Zig LSP Codegen | ||
|
||
## Usage | ||
Generates `std.json` compatible Zig code based on the official [LSP MetaModel](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#metaModel) | ||
|
||
1. `git clone` | ||
2. Plop `metaModel.json` in this cloned repo. A copy can be found [here](https://github.com/microsoft/vscode-languageserver-node/blob/main/protocol/metaModel.json). | ||
3. `zig build` | ||
4. Tada! You should now have a `zig-out/artifacts/lsp.zig` file that can be used to your heart's content! Enjoy :) | ||
## Installation | ||
|
||
```bash | ||
# Initialize a `zig build` project if you haven't already | ||
zig init | ||
# Add the `lsp-codegen` package to your `build.zig.zon` | ||
zig fetch --save=lsp-codegen git+https://github.com/zigtools/zig-lsp-codegen.git#<git-commit-hash> | ||
``` | ||
|
||
You can then import `lsp-codegen` in your `build.zig` with: | ||
|
||
```zig | ||
const lsp_codegen = b.dependency("lsp-codegen", .{}); | ||
const exe = b.addExecutable(...); | ||
exe.root_module.addImport("lsp", lsp_codegen.module("lsp")); | ||
``` |
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.