Search in sources :

Example 1 with ADL14Parser

use of com.nedap.archie.adl14.ADL14Parser in project archetype-languageserver by nedap.

the class ADL14ConvertingStorage method addFile.

public void addFile(TextDocumentItem item) {
    ADL14Parser adl14Parser = new ADL14Parser(BuiltinReferenceModels.getMetaModels());
    Archetype archetype = null;
    try {
        archetype = adl14Parser.parse(item.getText(), configuration);
        textService.pushDiagnostics(new VersionedTextDocumentIdentifier(item.getUri(), item.getVersion()), null, new ValidationResult(archetype));
        adl14Files.put(item.getUri(), archetype);
    } catch (ADLParseException ex) {
        textService.pushDiagnostics(new VersionedTextDocumentIdentifier(item.getUri(), item.getVersion()), ex.getErrors());
    }
}
Also used : VersionedTextDocumentIdentifier(org.eclipse.lsp4j.VersionedTextDocumentIdentifier) Archetype(com.nedap.archie.aom.Archetype) ADL14Parser(com.nedap.archie.adl14.ADL14Parser) ValidationResult(com.nedap.archie.archetypevalidator.ValidationResult) ADLParseException(com.nedap.archie.adlparser.ADLParseException)

Aggregations

ADL14Parser (com.nedap.archie.adl14.ADL14Parser)1 ADLParseException (com.nedap.archie.adlparser.ADLParseException)1 Archetype (com.nedap.archie.aom.Archetype)1 ValidationResult (com.nedap.archie.archetypevalidator.ValidationResult)1 VersionedTextDocumentIdentifier (org.eclipse.lsp4j.VersionedTextDocumentIdentifier)1