Search in sources :

Example 1 with ApplicationYamlReconcileEngine

use of org.springframework.ide.vscode.boot.yaml.reconcile.ApplicationYamlReconcileEngine in project sts4 by spring-projects.

the class BootPropertiesLanguageServerComponents method getReconcileEngine.

@Override
public Optional<IReconcileEngine> getReconcileEngine() {
    IReconcileEngine propertiesReconciler = new SpringPropertiesReconcileEngine(indexProvider, typeUtilProvider);
    IReconcileEngine ymlReconciler = new ApplicationYamlReconcileEngine(parser, indexProvider, typeUtilProvider);
    return Optional.of((doc, problemCollector) -> {
        String uri = doc.getUri();
        if (uri != null) {
            if (uri.endsWith(PROPERTIES)) {
                propertiesReconciler.reconcile(doc, problemCollector);
                return;
            } else if (uri.endsWith(YML)) {
                ymlReconciler.reconcile(doc, problemCollector);
                return;
            }
        }
        // No real reconciler is applicable. So tell the problemCollector there are no problems.
        problemCollector.beginCollecting();
        problemCollector.endCollecting();
    });
}
Also used : IReconcileEngine(org.springframework.ide.vscode.commons.languageserver.reconcile.IReconcileEngine) ApplicationYamlReconcileEngine(org.springframework.ide.vscode.boot.yaml.reconcile.ApplicationYamlReconcileEngine) SpringPropertiesReconcileEngine(org.springframework.ide.vscode.boot.properties.reconcile.SpringPropertiesReconcileEngine)

Aggregations

SpringPropertiesReconcileEngine (org.springframework.ide.vscode.boot.properties.reconcile.SpringPropertiesReconcileEngine)1 ApplicationYamlReconcileEngine (org.springframework.ide.vscode.boot.yaml.reconcile.ApplicationYamlReconcileEngine)1 IReconcileEngine (org.springframework.ide.vscode.commons.languageserver.reconcile.IReconcileEngine)1