1
1
use biome_js_factory:: make;
2
- use biome_js_formatter:: { context:: JsFormatOptions , format_node} ;
2
+ use biome_js_formatter:: {
3
+ context:: JsFormatOptions , format_node, JsForeignLanguage , JsForeignLanguageFormatter ,
4
+ } ;
3
5
use biome_js_syntax:: {
4
6
AnyJsBinding , AnyJsBindingPattern , AnyJsCallArgument , AnyJsDeclaration , AnyJsDeclarationClause ,
5
7
AnyJsExportClause , AnyJsExpression , AnyJsFormalParameter , AnyJsImportClause ,
@@ -13,6 +15,19 @@ use biome_string_case::Case;
13
15
use xtask:: { project_root, Mode , Result } ;
14
16
use xtask_codegen:: update;
15
17
18
+ #[ derive( Debug , Clone ) ]
19
+ struct FakeFormater ;
20
+
21
+ impl JsForeignLanguageFormatter for FakeFormater {
22
+ fn format (
23
+ & self ,
24
+ _language : JsForeignLanguage ,
25
+ _content : & str ,
26
+ ) -> biome_formatter:: FormatResult < biome_formatter:: prelude:: Document > {
27
+ Err ( biome_formatter:: FormatError :: SyntaxError )
28
+ }
29
+ }
30
+
16
31
pub ( crate ) fn generate_workspace_bindings ( mode : Mode ) -> Result < ( ) > {
17
32
let bindings_path = project_root ( ) . join ( "packages/@biomejs/backend-jsonrpc/src/workspace.ts" ) ;
18
33
let methods = methods ( ) ;
@@ -424,7 +439,12 @@ pub(crate) fn generate_workspace_bindings(mode: Mode) -> Result<()> {
424
439
)
425
440
. build ( ) ;
426
441
427
- let formatted = format_node ( JsFormatOptions :: new ( JsFileSource :: ts ( ) ) , module. syntax ( ) ) . unwrap ( ) ;
442
+ let formatted = format_node (
443
+ JsFormatOptions :: new ( JsFileSource :: ts ( ) ) ,
444
+ FakeFormater ,
445
+ module. syntax ( ) ,
446
+ )
447
+ . unwrap ( ) ;
428
448
let printed = formatted. print ( ) . unwrap ( ) ;
429
449
let code = printed. into_code ( ) ;
430
450
0 commit comments