Search in sources :

Example 1 with YamlCompletionEngine

use of org.springframework.ide.vscode.commons.yaml.completion.YamlCompletionEngine in project sts4 by spring-projects.

the class BootPropertiesLanguageServerComponents method getCompletionEngine.

@Override
public ICompletionEngine getCompletionEngine() {
    ICompletionEngine propertiesCompletions = new SpringPropertiesCompletionEngine(indexProvider, typeUtilProvider, javaProjectFinder);
    ICompletionEngine yamlCompletions = new YamlCompletionEngine(yamlStructureProvider, yamlAssistContextProvider, COMPLETION_OPTIONS);
    return (TextDocument document, int offset) -> {
        String uri = document.getUri();
        if (uri != null) {
            if (uri.endsWith(PROPERTIES)) {
                return propertiesCompletions.getCompletions(document, offset);
            } else if (uri.endsWith(YML)) {
                return yamlCompletions.getCompletions(document, offset);
            }
        }
        return ImmutableList.of();
    };
}
Also used : ICompletionEngine(org.springframework.ide.vscode.commons.languageserver.completion.ICompletionEngine) TextDocument(org.springframework.ide.vscode.commons.util.text.TextDocument) SpringPropertiesCompletionEngine(org.springframework.ide.vscode.boot.properties.completions.SpringPropertiesCompletionEngine) YamlCompletionEngine(org.springframework.ide.vscode.commons.yaml.completion.YamlCompletionEngine)

Aggregations

SpringPropertiesCompletionEngine (org.springframework.ide.vscode.boot.properties.completions.SpringPropertiesCompletionEngine)1 ICompletionEngine (org.springframework.ide.vscode.commons.languageserver.completion.ICompletionEngine)1 TextDocument (org.springframework.ide.vscode.commons.util.text.TextDocument)1 YamlCompletionEngine (org.springframework.ide.vscode.commons.yaml.completion.YamlCompletionEngine)1