use of com.nedap.openehr.lsp.symbolextractor.adl14.ADL14SymbolExtractor in project archetype-languageserver by nedap.
the class BroadcastingArchetypeRepository method extractADL14Info.
private void extractADL14Info(TextDocumentItem textDocumentItem) {
adl14Storage.addFile(textDocumentItem);
// make sure any ADL 2 things get removed here!
ADL14SymbolExtractor adlSymbolExtractor = new ADL14SymbolExtractor();
try {
DocumentInformation documentInformation = adlSymbolExtractor.extractSymbols(textDocumentItem.getUri(), textDocumentItem.getText());
symbolsByUri.put(textDocumentItem.getUri(), documentInformation);
if (documentInformation.getArchetypeId() != null) {
documentsByArchetypeId.put(documentInformation.getArchetypeId(), textDocumentItem);
}
resolveDocumentLinks();
Archetype archetype = adl14Storage.getArchetype(new TextDocumentIdentifier(textDocumentItem.getUri()));
if (archetype != null) {
String language = archetype.getOriginalLanguage() != null ? archetype.getOriginalLanguage().getCodeString() : null;
if (language == null) {
language = "en";
}
SymbolNameFromTerminologyHelper.giveNames(documentInformation.getSymbols(), archetype, language);
}
} catch (IOException e) {
throw new RuntimeException(e);
}
return;
}
Aggregations