Skip to content

Commit

Permalink
Remove TextMate generator and use the one fro the CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
Lotes committed Apr 23, 2024
1 parent cf9f6d0 commit 7ea70ea
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 260 deletions.
8 changes: 3 additions & 5 deletions hugo/content/playground/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
* This program and the accompanying materials are made available under the
* terms of the MIT License, which is available in the project root.
******************************************************************************/

import {
HelloWorldGrammar,
LangiumTextMateContent,
Expand All @@ -17,7 +16,7 @@ import { addMonacoStyles, createUserConfig, MonacoEditorLanguageClientWrapper }
import { DocumentChangeResponse } from "langium-ast-helper";
import { DefaultAstNodeLocator } from "langium";
import { createServicesForGrammar } from "langium/grammar";
import { generateTextMate } from "./textmate-generator.js";
import { generateTextMate } from "langium-cli/textmate";
export { share, overlay } from './utils.js';
export { addMonacoStyles, MonacoEditorLanguageClientWrapper };

Expand Down Expand Up @@ -210,17 +209,16 @@ async function getFreshDSLWrapper(
code: string,
grammarText: string
): Promise<MonacoEditorLanguageClientWrapper | undefined> {

// construct and set a new monarch syntax onto the editor
const { Grammar } = await createServicesForGrammar({ grammar: grammarText });

const worker = await getLSWorkerForGrammar(grammarText);
const wrapper = new MonacoEditorLanguageClientWrapper();
const textmateGrammar = JSON.parse(generateTextMate(Grammar, { id: languageId, grammar: 'UserGrammar' }));
return wrapper.start(createUserConfig({
languageId,
code,
worker,
textmateGrammar: generateTextMate(Grammar, {id: languageId, grammar: 'UserGrammar'})
textmateGrammar
}), htmlElement).then(() => {
return wrapper;
}).catch(async (e: any) => {
Expand Down
255 changes: 0 additions & 255 deletions hugo/content/playground/textmate-generator.ts

This file was deleted.

1 change: 1 addition & 0 deletions hugo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"langium": "^3.0.0",
"langium-arithmetics-dsl": "^3.0.0",
"langium-ast-helper": "0.1.2",
"langium-cli": "^3.0.2",
"langium-domainmodel-dsl": "^3.0.0",
"langium-minilogo": "^3.0.0",
"langium-sql": "^0.3.2",
Expand Down
Loading

0 comments on commit 7ea70ea

Please sign in to comment.