Skip to content

Commit f88b7b2

Browse files
authored
chore: update codegen to include GraphQL (#3301)
1 parent 55fd8ed commit f88b7b2

File tree

8 files changed

+150
-50
lines changed

8 files changed

+150
-50
lines changed

Cargo.lock

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/biome_configuration/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ biome_deserialize_macros = { workspace = true }
2222
biome_diagnostics = { workspace = true }
2323
biome_flags = { workspace = true }
2424
biome_formatter = { workspace = true, features = ["serde"] }
25+
biome_graphql_analyze = { workspace = true }
26+
biome_graphql_syntax = { workspace = true }
2527
biome_js_analyze = { workspace = true }
2628
biome_js_formatter = { workspace = true, features = ["serde"] }
2729
biome_js_syntax = { workspace = true, features = ["serde", "schema"] }
@@ -47,6 +49,7 @@ schema = [
4749
"biome_formatter/serde",
4850
"biome_json_syntax/schema",
4951
"biome_css_syntax/schema",
52+
"biome_graphql_syntax/schema",
5053
]
5154

5255
[dev-dependencies]

crates/biome_configuration/src/linter/rules.rs

Lines changed: 48 additions & 28 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/biome_service/tests/workspace.rs

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#[cfg(test)]
22
mod test {
3+
use biome_analyze::RuleCategories;
4+
use biome_configuration::linter::{RuleGroup, RuleSelector};
35
use biome_fs::BiomePath;
46
use biome_js_syntax::{JsFileSource, TextSize};
57
use biome_service::file_handlers::DocumentFileSource;
@@ -185,7 +187,7 @@ mod test {
185187
content: r#"type Query {
186188
me: User
187189
}
188-
190+
189191
type User {
190192
id: ID
191193
name: String
@@ -202,4 +204,35 @@ type User {
202204

203205
assert!(syntax.starts_with("GraphqlRoot"))
204206
}
207+
208+
#[test]
209+
fn correctly_pulls_lint_diagnostics() {
210+
let workspace = create_server();
211+
212+
let graphql_file = FileGuard::open(
213+
workspace.as_ref(),
214+
OpenFileParams {
215+
path: BiomePath::new("file.graphql"),
216+
content: r#"query {
217+
member @deprecated(abc: 123)
218+
}"#
219+
.into(),
220+
version: 0,
221+
document_file_source: None,
222+
},
223+
)
224+
.unwrap();
225+
let result = graphql_file.pull_diagnostics(
226+
RuleCategories::all(),
227+
10,
228+
vec![RuleSelector::Rule(
229+
RuleGroup::Nursery,
230+
"useDeprecatedReason",
231+
)],
232+
vec![],
233+
);
234+
assert!(result.is_ok());
235+
let diagnostics = result.unwrap().diagnostics;
236+
assert_eq!(diagnostics.len(), 1)
237+
}
205238
}

packages/@biomejs/backend-jsonrpc/src/workspace.ts

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@biomejs/biome/configuration_schema.json

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)