File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
hugo/content/docs/recipes Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,8 @@ Langium's formatting API allows to easily create formatters for your language.
77We start building a custom formatter for our language by creating a new class that inherits from ` AbstractFormatter ` .
88
99``` ts
10- import { AbstractFormatter , AstNode , Formatting } from ' langium' ;
10+ import { AstNode } from ' langium' ;
11+ import { AbstractFormatter , Formatting } from ' langium/lsp' ;
1112
1213export class CustomFormatter extends AbstractFormatter {
1314 protected format(node : AstNode ): void {
@@ -87,8 +88,9 @@ It will still correctly indent the node in case the indentation is not as expect
8788<summary >Full Code Sample</summary >
8889
8990``` ts
90- import { AbstractFormatter , AstNode , Formatting } from ' langium' ;
91- import * as ast from ' ./generated/ast' ;
91+ import { AstNode } from ' langium' ;
92+ import { AbstractFormatter , Formatting } from ' langium/lsp' ;
93+ import * as ast from ' ./generated/ast.js' ;
9294
9395export class DomainModelFormatter extends AbstractFormatter {
9496
You can’t perform that action at this time.
0 commit comments