From a1585c6f70d4f6d2d81a260bda7d6297b661f5e8 Mon Sep 17 00:00:00 2001 From: Knut Sveidqvist Date: Tue, 29 Apr 2025 17:18:46 +0200 Subject: [PATCH] Linting, removing debug files --- packages/parser/tests/test-print-esm.js | 24 ---------------------- packages/parser/tests/test-print.js | 27 ------------------------- 2 files changed, 51 deletions(-) delete mode 100644 packages/parser/tests/test-print-esm.js delete mode 100644 packages/parser/tests/test-print.js diff --git a/packages/parser/tests/test-print-esm.js b/packages/parser/tests/test-print-esm.js deleted file mode 100644 index 48a8ba99d..000000000 --- a/packages/parser/tests/test-print-esm.js +++ /dev/null @@ -1,24 +0,0 @@ -// Test file to print the parsed structure of a mindmap -import { createMindMapServices } from '../src/language/index.js'; - -// Create services -const mindMapServices = createMindMapServices().MindMap; -const mindMapParser = mindMapServices.parser.LangiumParser; - -// Function to parse mindmap -function parse(input) { - return mindMapParser.parse(input); -} - -// Test with a simple mindmap -const result = parse('mindmap\nroot\n child1\n child2'); - -// Print the result structure -console.log('Parse result:'); -console.log(JSON.stringify(result.value, null, 2)); - -// Print the first statement -if (result.value?.statements?.[0]) { - console.log('\nFirst statement:'); - console.log(JSON.stringify(result.value.statements[0], null, 2)); -} diff --git a/packages/parser/tests/test-print.js b/packages/parser/tests/test-print.js deleted file mode 100644 index c5c20f038..000000000 --- a/packages/parser/tests/test-print.js +++ /dev/null @@ -1,27 +0,0 @@ -// Test parsing -import { createMindMapServices } from '../lib/language/mindmap/module.js'; -import { parseDocument } from 'langium'; - -// Create services for handling the language -const services = createMindMapServices(); -// Get the service for parsing documents -const documentBuilder = services.MindMap.shared.workspace.DocumentBuilder; - -// Sample mindmap text to parse -const text = 'mindmap\nroot\n child1\n child2'; - -// Parse the document -const doc = documentBuilder.buildDocuments([ - { - uri: 'file:///test.mindmap', - content: text, - version: 1, - }, -]); - -// Get the parsed document -const result = Array.isArray(doc) ? doc[0] : undefined; -if (result) { - console.log('AST:', JSON.stringify(result.parseResult.value, null, 2)); - console.log('First node:', JSON.stringify(result.parseResult.value.statements?.[0], null, 2)); -}