use of org.stepik.api.objects.steps.BlockView in project intellij-plugins by StepicOrg.
the class StepNode method getSupportedLanguages.
@NotNull
public List<SupportedLanguages> getSupportedLanguages() {
if (supportedLanguages == null) {
supportedLanguages = new ArrayList<>();
BlockView block;
Step data = getData();
if (data == null) {
return supportedLanguages;
}
block = data.getBlock();
if (getType() == StepType.CODE) {
BlockViewOptions options = block.getOptions();
Map<String, String> templates = options.getCodeTemplates();
templates.keySet().forEach(key -> {
SupportedLanguages language = SupportedLanguages.langOfName(key);
if (language != INVALID && !supportedLanguages.contains(language)) {
supportedLanguages.add(language);
}
});
}
}
return supportedLanguages;
}
Aggregations