Conversation
❌ Deploy Preview for biomejs failed. Why did it fail? →
|
4e6139c to
b16610c
Compare
|
ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughThis PR implements automatic generation of Biome daemon JSON-RPC API documentation. A new code generator reads biome_service method schemas, converts them to TypeScript interfaces, and injects the result into daemon.md. The changes update the codegen crate's dependencies to a newer biome commit, add the Lsp CLI subcommand, implement the core schema-to-markdown transformation logic, wire it into the codegen entrypoint and npm script, and expose the new documentation alongside reorganised editor integration guides that introduce go-to-definition settings for VS Code and Zed. Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 8
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@codegen/src/lsp.rs`:
- Around line 18-20: The generated heading uses h3 ("### `biome/{}`") which
conflicts with the TOC strategy noted in the comment; update the string
construction in codegen/src/lsp.rs where output.push_str(&format!("###
`biome/{}`\n\n", method.name)); to emit an h4 heading instead (use four #
characters) so it matches the intended h4 level for the `biome/{}` section and
avoids polluting the table of contents; ensure you only change the literal
heading marker around method.name.
- Around line 69-73: The is_primitive_schema function currently only treats
"null", "boolean", and "string" as primitives; update its type check to also
include "number" and "integer" so numeric JSON Schema types are detected as
primitives. Locate the matches! call in is_primitive_schema (working on the
schema: &Value) and add "number" and "integer" to the Some(...) arm so numeric
params render as primitive (e.g., "Accepts `number`") instead of falling through
to interface rendering.
- Around line 47-53: The expect() messages used when finding START_MARKER and
END_MARKER are misleading (they mention introduction.mdx) — update the two
expect(...) error strings in the block that computes start_idx and end_idx (the
calls that use content.find(START_MARKER) and content.find(END_MARKER)) to
reference the correct target file/section for this function instead of
"introduction.mdx" so errors point to the actual file being edited; keep the
rest of the logic unchanged and preserve START_MARKER.len() usage for start_idx.
In `@src/content/docs/editors/introduction.mdx`:
- Line 164: The link in the sentence containing "Using the binary via CLI..."
still points to the old anchor `#daemon-logs`; update that anchor to match the
current heading by replacing `#daemon-logs` with `#language-server-logs` so the
in-page jump targets the "Language Server logs" section correctly.
- Around line 2-3: The frontmatter "description" in the Biome Language Server
doc (the description field in src/content/docs/editors/introduction.mdx) is
placeholder text; replace the placeholder value with a concise, accurate summary
of the page (a one- or two-sentence description) so search previews and docs
metadata display meaningful content, ensuring you update the frontmatter
description key while keeping the existing title intact.
- Around line 10-26: The three list items labeled
`woskpace/didChangeConfiguration`, `woskpace/didChangeWatchedFiles`, and
`woskpace/didChangeWorkspaceFolders` contain a typo — change `woskpace` to
`workspace`; also fix the `textDocument/definition` link so it matches the other
spec URLs by adding the missing `/specification/` path segment (use the same
pattern as the other links, e.g. the specification-style URL for
`textDocument/definition`).
In `@src/content/docs/reference/daemon.md`:
- Around line 10-19: The example for the "biome/open_project" JSON-RPC call uses
the wrong parameter name; replace the "openInitialized" field in the example
params with "openUninitialized" to match the schema/docs (or vice‑versa if you
prefer to standardize on "openInitialized") so both the example JSON and the
documented parameter (openUninitialized) are identical; update the method
example's "params" object to use the same parameter name as the documented
schema (openUninitialized) and ensure any other examples in the same section
(lines ~82-91) are updated the same way.
- Around line 6-8: Fix the intro typos and clarify the phrasing: change "my" to
"by", correct "paylod" to "payload", and reword the sentence "where `method` is
the one of the methods listed in this page." to "where `method` is one of the
methods listed on this page." Also ensure the JSON-RPC reference and example
`biome/open_project` remain intact and punctuate the sentences for clarity.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: de3747e2-bd55-4077-9ae5-3dfa0a352aef
⛔ Files ignored due to path filters (1)
Cargo.lockis excluded by!**/*.lock
📒 Files selected for processing (12)
Cargo.tomlastro.config.tscodegen/src/lib.rscodegen/src/lsp.rscodegen/src/main.rspackage.jsonsrc/content/docs/editors/first-party-extensions.mdxsrc/content/docs/editors/introduction.mdxsrc/content/docs/editors/third-party-extensions.mdxsrc/content/docs/reference/daemon.mdsrc/content/docs/reference/vscode.mdxsrc/content/docs/reference/zed.mdx
44495ae to
16ff5ed
Compare
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: Emanuele Stoppa <my.burning@gmail.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Actionable comments posted: 5
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@codegen/src/lsp.rs`:
- Around line 76-83: primitive_ts_name is missing branches for numeric schemas
so numeric types fall through to interface rendering; update primitive_ts_name
to handle schema.get("type") == "number" and "integer" (returning
Some("number")) so it matches is_primitive_schema's treatment and numeric return
types render as "number".
- Around line 68-74: The function is_primitive_schema in lsp.rs contains a stray
closing brace after its definition causing a syntax error; remove the extra `}`
following the closing of is_primitive_schema so the braces balance correctly
(i.e., ensure only the function's closing brace remains and delete the lone
extra brace that follows).
In `@src/content/docs/editors/introduction.mdx`:
- Line 124: Fix the typo in the sentence "You can integrate Biome in your editor
extension is different ways." by replacing the incorrect word "is" with "in" so
the line reads "You can integrate Biome in your editor extension in different
ways."; update the text in the editors/introduction.mdx content where that
sentence appears.
- Line 160: Fix the typo and pluralization in the sentence that reads "The
language server exposes [some options](/editors/introduction#extension-settings)
that editor extension can exposse to users" — change it to "The language server
exposes [some options](/editors/introduction#extension-settings) that editor
extensions can expose to users" by correcting "exposse" → "expose" and making
"extension" plural.
- Line 132: Fix the sentence fragment "If your editor is able to interact with a
server and send [JSON-RPC] request, you only need to configure the editor run
that command." by inserting the missing preposition "to" before "run" and
pluralizing "request" to "requests" for grammatical consistency; target the
sentence starting "If your editor is able to interact with a server and send
[JSON-RPC] request" in src/content/docs/editors/introduction.mdx and update it
to read "...and send [JSON-RPC] requests, you only need to configure the editor
to run that command."
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 150baec3-c93b-4936-80f3-efb470cae0e9
⛔ Files ignored due to path filters (1)
Cargo.lockis excluded by!**/*.lock
📒 Files selected for processing (12)
Cargo.tomlastro.config.tscodegen/src/lib.rscodegen/src/lsp.rscodegen/src/main.rspackage.jsonsrc/content/docs/editors/first-party-extensions.mdxsrc/content/docs/editors/introduction.mdxsrc/content/docs/editors/third-party-extensions.mdxsrc/content/docs/reference/daemon.mdsrc/content/docs/reference/vscode.mdxsrc/content/docs/reference/zed.mdx
✅ Files skipped from review due to trivial changes (4)
- src/content/docs/reference/zed.mdx
- src/content/docs/reference/vscode.mdx
- codegen/src/lib.rs
- src/content/docs/reference/daemon.md
🚧 Files skipped from review as they are similar to previous changes (3)
- Cargo.toml
- codegen/src/main.rs
- astro.config.ts
| fn primitive_ts_name(schema: &Value) -> Option<&'static str> { | ||
| match schema.get("type").and_then(|v| v.as_str()) { | ||
| Some("null") => Some("void"), | ||
| Some("boolean") => Some("boolean"), | ||
| Some("string") => Some("string"), | ||
| _ => None, | ||
| } | ||
| } |
There was a problem hiding this comment.
primitive_ts_name doesn't handle number/integer.
is_primitive_schema now correctly treats number and integer as primitives (line 71), but primitive_ts_name doesn't return a value for them. This means numeric return types will fall through to interface rendering instead of showing "Returns number".
Suggested fix
fn primitive_ts_name(schema: &Value) -> Option<&'static str> {
match schema.get("type").and_then(|v| v.as_str()) {
Some("null") => Some("void"),
Some("boolean") => Some("boolean"),
Some("string") => Some("string"),
+ Some("number" | "integer") => Some("number"),
_ => None,
}
}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| fn primitive_ts_name(schema: &Value) -> Option<&'static str> { | |
| match schema.get("type").and_then(|v| v.as_str()) { | |
| Some("null") => Some("void"), | |
| Some("boolean") => Some("boolean"), | |
| Some("string") => Some("string"), | |
| _ => None, | |
| } | |
| } | |
| fn primitive_ts_name(schema: &Value) -> Option<&'static str> { | |
| match schema.get("type").and_then(|v| v.as_str()) { | |
| Some("null") => Some("void"), | |
| Some("boolean") => Some("boolean"), | |
| Some("string") => Some("string"), | |
| Some("number" | "integer") => Some("number"), | |
| _ => None, | |
| } | |
| } |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@codegen/src/lsp.rs` around lines 76 - 83, primitive_ts_name is missing
branches for numeric schemas so numeric types fall through to interface
rendering; update primitive_ts_name to handle schema.get("type") == "number" and
"integer" (returning Some("number")) so it matches is_primitive_schema's
treatment and numeric return types render as "number".
|
|
||
| ## Integrate Biome in an editor extension | ||
|
|
||
| You can integrate Biome in your editor extension is different ways. |
There was a problem hiding this comment.
Typo: "is" should be "in".
Small grammar fix needed.
-You can integrate Biome in your editor extension is different ways.
+You can integrate Biome in your editor extension in different ways.📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| You can integrate Biome in your editor extension is different ways. | |
| You can integrate Biome in your editor extension in different ways. |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/content/docs/editors/introduction.mdx` at line 124, Fix the typo in the
sentence "You can integrate Biome in your editor extension is different ways."
by replacing the incorrect word "is" with "in" so the line reads "You can
integrate Biome in your editor extension in different ways."; update the text in
the editors/introduction.mdx content where that sentence appears.
| - a [daemon](/internals/architecture#daemon) that does execute the requested operations; | ||
| - a server that functions as a proxy between the requests of the client - the editor - and the server - the daemon; | ||
|
|
||
| If your editor is able to interact with a server and send [JSON-RPC](https://www.jsonrpc.org/) request, you only need to configure the editor run that command. |
There was a problem hiding this comment.
Missing preposition "to".
-If your editor is able to interact with a server and send [JSON-RPC](https://www.jsonrpc.org/) request, you only need to configure the editor run that command.
+If your editor can interact with a server and send [JSON-RPC](https://www.jsonrpc.org/) requests, you only need to configure the editor to run that command.Also changed "request" to "requests" for grammatical consistency.
🧰 Tools
🪛 LanguageTool
[style] ~132-~132: As a shorter alternative for ‘able to’, consider using “can”.
Context: ...he server - the daemon; If your editor is able to interact with a server and send [JSON-R...
(BE_ABLE_TO)
[uncategorized] ~132-~132: Possible missing preposition found.
Context: ..., you only need to configure the editor run that command. You can check how the [`...
(AI_HYDRA_LEO_MISSING_TO)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/content/docs/editors/introduction.mdx` at line 132, Fix the sentence
fragment "If your editor is able to interact with a server and send [JSON-RPC]
request, you only need to configure the editor run that command." by inserting
the missing preposition "to" before "run" and pluralizing "request" to
"requests" for grammatical consistency; target the sentence starting "If your
editor is able to interact with a server and send [JSON-RPC] request" in
src/content/docs/editors/introduction.mdx and update it to read "...and send
[JSON-RPC] requests, you only need to configure the editor to run that command."
|
|
||
| The binary name is `biome` or `biome.exe`, and it can be found in the root directory of the library, e.g.: `@biomejs/cli-darwin-arm64/biome`, `@biomejs/cli-win32-x64/biome.exe`. | ||
|
|
||
| The language server exposes [some options](/editors/introduction#extension-settings) that editor extension can exposse to users. |
There was a problem hiding this comment.
Typo: "exposse" → "expose".
-The language server exposes [some options](/editors/introduction#extension-settings) that editor extension can exposse to users.
+The language server exposes [some options](/editors/introduction#extension-settings) that editor extensions can expose to users.Also added plural "extensions" for consistency.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| The language server exposes [some options](/editors/introduction#extension-settings) that editor extension can exposse to users. | |
| The language server exposes [some options](/editors/introduction#extension-settings) that editor extensions can expose to users. |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/content/docs/editors/introduction.mdx` at line 160, Fix the typo and
pluralization in the sentence that reads "The language server exposes [some
options](/editors/introduction#extension-settings) that editor extension can
exposse to users" — change it to "The language server exposes [some
options](/editors/introduction#extension-settings) that editor extensions can
expose to users" by correcting "exposse" → "expose" and making "extension"
plural.
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
| translations: { | ||
| es: "Biome en tu IDE", | ||
| fr: "Biome dans votre IDE", | ||
| ja: "Biome をあなたのエディタに導入する", | ||
| "zh-CN": "编辑器中使用 Biome", | ||
| pl: "Biome w Twoim IDE", | ||
| "pt-BR": "Biome no seu editor", | ||
| uk: "Biome в вашому IDE", | ||
| ru: "Biome в вашей IDE", | ||
| }, |
There was a problem hiding this comment.
Nitpick: Translations are outdated.
Summary
This PR refactors and enhances the section relative to the language server. Now that we are shipping more features targeted to editors e.g. biomejs/biome#9700, I thought it was time to add more information to what it can do.
Here's what the PR contains: