diff --git a/packages/langium-vscode/README.md b/packages/langium-vscode/README.md index 8f8b11f82..5dd12a714 100644 --- a/packages/langium-vscode/README.md +++ b/packages/langium-vscode/README.md @@ -1,8 +1,9 @@ # Langium Support for VS Code -This extension contributes a language server for the [Langium](https://langium.org) grammar declaration language. It is built with Langium itself. +This extension contributes support for the [Langium](https://langium.org) grammar declaration language. The underlying language server is built with Langium itself. + +## Language Features -Contributed features: * Syntax highlighting * Completion * Diagnostics @@ -12,3 +13,9 @@ Contributed features: * Document highlighting * Document symbols * Semantic tokens highlighting + +## Syntax Diagrams + +Langium grammar files can be visualised as syntax diagrams using the *Show Railroad Syntax Diagram* button that appears in the tab bar of `.langium` files. + +![Example Syntax Diagram](https://github.com/langium/langium/assets/4377073/fe50828b-2a2a-474e-b065-8a05b3ce23cf) diff --git a/packages/langium-vscode/package.json b/packages/langium-vscode/package.json index 3c81903c2..908edb602 100644 --- a/packages/langium-vscode/package.json +++ b/packages/langium-vscode/package.json @@ -22,7 +22,7 @@ "commands": [ { "command": "langium.showRailroadDiagram", - "title": "Show railroad syntax diagram", + "title": "Show Railroad Syntax Diagram", "category": "Langium", "icon": "$(list-tree)" } diff --git a/packages/langium-vscode/src/railroad-webview.ts b/packages/langium-vscode/src/railroad-webview.ts index ff2ae2692..b6da942e1 100644 --- a/packages/langium-vscode/src/railroad-webview.ts +++ b/packages/langium-vscode/src/railroad-webview.ts @@ -53,7 +53,7 @@ export class RailroadDiagramPanel implements vscode.Disposable { private disposables: vscode.Disposable[] = []; static current?: RailroadDiagramPanel; - static readonly viewType = 'railroadDiagram'; + static readonly viewType = 'LangiumRailroadDiagram'; static createOrShow(client: LanguageClient, fileUri: vscode.Uri): void { if (this.current) {