Skip to content

Commit

Permalink
feat: support for JSON and JSONC
Browse files Browse the repository at this point in the history
  • Loading branch information
ematipico committed Apr 18, 2024
1 parent 106d6b9 commit 3734d64
Show file tree
Hide file tree
Showing 12 changed files with 299 additions and 43 deletions.
5 changes: 5 additions & 0 deletions .changeset/added_support_for_json_and_jsonc_files.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
default: patch
---

# Added support for JSON and JSONC files
45 changes: 45 additions & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Jobs run on pull request
name: Pull request
on:
workflow_dispatch:
pull_request:
branches:
- main

env:
RUST_LOG: info
RUST_BACKTRACE: 1

jobs:
format:
name: Format
runs-on: ubuntu-latest
steps:
- name: Checkout PR branch
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- name: Install toolchain
uses: moonrepo/setup-rust@b8edcc56aab474d90c7cf0bb8beeaf8334c15e9f # v1
with:
components: rustfmt
bins: taplo-cli
cache-base: main
- name: Run format
run: |
cargo fmt --all --check
taplo format --check
lint:
name: Lint Rust Files
runs-on: ubuntu-latest
steps:
- name: Checkout PR Branch
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- name: Free Disk Space
uses: ./.github/actions/free-disk-space
- name: Install toolchain
uses: moonrepo/setup-rust@b8edcc56aab474d90c7cf0bb8beeaf8334c15e9f # v1
with:
components: clippy
cache-base: main
- name: Run clippy
run: cargo clippy --all-targets -- --deny warnings
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Changelog

33 changes: 33 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,36 @@
## Setup

For development instruction see [Authoring Zed Extensions](https://github.com/zed-industries/extensions/blob/main/AUTHORING_EXTENSIONS.md).

## Development

### Install the required tools

We use [Just](https://just.systems/man/en/) to run scripts and tasks, to make our life easier.

You can install `just` using cargo:

```shell
cargo install just
```

But we **highly recommend
** to [install it using an OS package manager](https://github.com/casey/just#packages), so you won't need to prefix every command with `cargo`.

Once installed, run the following command install the required tools:

```shell
just install-tools
```

1. Clone this repository.
1. Open Zed
1. Open the command palette <kbd>Ctrl</kbd>/<kbd title="Cmd">⌘</kbd>+<kbd title="Shift">⇧</kbd>+<kbd>P</kbd>
1. Run the `zed: install dev extensions` command.
1. Select the directory of this repo.

If you make changes to the Rust code and you require to reload the extension, you can open the "Extensions" tab by running the command `zed: extensions`, choose the `"Installed"`, seek the current extension and click the `"Rebuild"` label.

#### Logs

Zed will print logs in the following directory: `~/Library/Logs/Zed/Zed.log`
155 changes: 152 additions & 3 deletions Cargo.lock

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

13 changes: 8 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
[package]
name = "zed_biome"
version = "0.0.1"
edition = "2021"
publish = false
license = "MIT"
name = "zed_biome"
publish = false
version = "0.0.3"

[lib]
path = "src/biome.rs"
crate-type = ["cdylib"]
path = "src/biome.rs"

[dependencies]
zed_extension_api = "0.0.5"
log = "0.4.21"
tracing = "0.1.40"
tracing-subscriber = "0.3.18"
zed_extension_api = "0.0.6"
6 changes: 0 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,6 @@ Requires Zed >= **v0.131.0**.

This extension is available in the extensions view inside the Zed editor. Open `zed: extensions` and search for _Biome_.

### Development

1. Clone this repository.
2. Run the `zed: install dev extensions` command.
3. Select the directory of this repo.

## Configuration

Example configurations in zed `settings.json`.
Expand Down
39 changes: 17 additions & 22 deletions extension.toml
Original file line number Diff line number Diff line change
@@ -1,29 +1,24 @@
id = "biome"
name = "Biome"
description = "Biome support for Zed"
version = "0.0.2"
authors = ["biomejs <biomejs.dev>"]
description = "Biome support for Zed"
id = "biome"
name = "Biome"
repository = "https://github.com/biomejs/biome-zed"
schema_version = 1
authors = ["biomejs <biomejs.dev>"]
repository = "https://github.com/biomejs/biome-zed"
version = "0.0.3"

[language_servers.biome]
name = "Biome Language Server"
language = "JavaScript"
languages = [
"JavaScript",
"JSX",
"TypeScript",
"TSX",
"Vue.js",
"Astro",
"Svelte",
]
code_actions_kind = ["", "quickfix"]
language = "JavaScript"
languages = ["JavaScript", "JSX", "TypeScript", "TSX", "Vue.js", "Astro", "Svelte", "JSON", "JSONC"]
name = "Biome Language Server"

[language_servers.biome.language_ids]
"Astro" = "astro"
"JSON" = "json"
"JSONC" = "jsonc"
"JSX" = "javascriptreact"
"JavaScript" = "javascript"
"JSX" = "javascriptreact"
"Svelte" = "svelte"
"TSX" = "typescriptreact"
"TypeScript" = "typescript"
"TSX" = "typescriptreact"
"Vue.js" = "vuejs"
"Astro" = "astro"
"Svelte" = "svelte"
"Vue.js" = "vuejs"
Loading

0 comments on commit 3734d64

Please sign in to comment.