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

feat: add GraphQL support #47

Merged
merged 1 commit into from
Sep 18, 2024
Merged
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
86 changes: 3 additions & 83 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,94 +28,14 @@ Languages currently supported:
- **Astro**
- **Svelte**
- **CSS**
- **GraphQL**

## Installation

Requires Zed >= **v0.131.0**.

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

## Configuration
## Documentation

By default, the biome.json file is required to be in the **root of the workspace**.

Otherwise, it can be configured through the lsp settings:

```jsonc
// settings.json
{
"lsp": {
"biome": {
"settings": {
"config_path": "<path>/biome.json"
}
}
}
}
```

### Formatting

To use the language server as a formatter, specify biome as your formatter in the settings:

```jsonc
// settings.json
{
"formatter": {
"language_server": {
"name": "biome"
}
}
}
```

### Enable biome only when biome.json is present

```jsonc
// settings.json
{
"lsp": {
"biome": {
"settings": {
"require_config_file": true
}
}
}
}
```

### Project based configuration

If you'd like to exclude biome from running in every project,

1. Disable the biome language server in user settings:

```jsonc
// settings.json
{
"language_servers": [ "!biome", "..." ]
}
```

2. And enable it in the project's local settings:

```jsonc
// <workspace>/.zed/settings.json
{
"language_servers": [ "biome", "..." ]
}
```

The same can be configured on a per-language basis with the [`languages`](https://zed.dev/docs/configuring-zed#languages) key.

### Run code actions on format:

```jsonc
// settings.json
{
"code_actions_on_format": {
"source.fixAll.biome": true,
"source.organizeImports.biome": true
}
}
```
Head to the [official documentation](https://biomejs.dev/reference/zed) to learn how to set up the extension, and customize it.
7 changes: 4 additions & 3 deletions extension.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,18 @@ id = "biome"
name = "Biome"
repository = "https://github.com/biomejs/biome-zed"
schema_version = 1
version = "0.1.2"
version = "0.1.3"

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

[language_servers.biome.language_ids]
"Astro" = "astro"
"CSS" = "css"
"GraphQL" = "graphql"
"JSON" = "json"
"JSONC" = "jsonc"
"JSX" = "javascriptreact"
Expand Down