Skip to content

Commit d0af3e1

Browse files
authored
formatting.md: Fix imports (#277)
1 parent ca16353 commit d0af3e1

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

hugo/content/docs/recipes/formatting.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ Langium's formatting API allows to easily create formatters for your language.
77
We 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

1213
export 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

9395
export class DomainModelFormatter extends AbstractFormatter {
9496

0 commit comments

Comments
 (0)