Linting, removing debug files

This commit is contained in:
Knut Sveidqvist
2025-04-29 17:18:46 +02:00
parent 5fcadd0e30
commit a1585c6f70
2 changed files with 0 additions and 51 deletions

View File

@@ -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));
}

View File

@@ -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));
}