Search in sources :

Example 1 with PropertiesHoverInfoProvider

use of org.springframework.ide.vscode.boot.properties.hover.PropertiesHoverInfoProvider in project sts4 by spring-projects.

the class BootPropertiesLanguageServerComponents method getHoverProvider.

@Override
public HoverHandler getHoverProvider() {
    HoverInfoProvider propertiesHovers = new PropertiesHoverInfoProvider(indexProvider, typeUtilProvider, javaProjectFinder);
    HoverInfoProvider ymlHovers = new YamlHoverInfoProvider(parser, yamlStructureProvider, yamlAssistContextProvider);
    HoverInfoProvider combined = (IDocument document, int offset) -> {
        String uri = document.getUri();
        if (uri != null) {
            if (uri.endsWith(PROPERTIES)) {
                return propertiesHovers.getHoverInfo(document, offset);
            } else if (uri.endsWith(YML)) {
                return ymlHovers.getHoverInfo(document, offset);
            }
        }
        return null;
    };
    return new VscodeHoverEngineAdapter(server, combined);
}
Also used : PropertiesHoverInfoProvider(org.springframework.ide.vscode.boot.properties.hover.PropertiesHoverInfoProvider) YamlHoverInfoProvider(org.springframework.ide.vscode.commons.yaml.hover.YamlHoverInfoProvider) HoverInfoProvider(org.springframework.ide.vscode.commons.languageserver.hover.HoverInfoProvider) PropertiesHoverInfoProvider(org.springframework.ide.vscode.boot.properties.hover.PropertiesHoverInfoProvider) YamlHoverInfoProvider(org.springframework.ide.vscode.commons.yaml.hover.YamlHoverInfoProvider) IDocument(org.springframework.ide.vscode.commons.util.text.IDocument) VscodeHoverEngineAdapter(org.springframework.ide.vscode.commons.languageserver.hover.VscodeHoverEngineAdapter)

Aggregations

PropertiesHoverInfoProvider (org.springframework.ide.vscode.boot.properties.hover.PropertiesHoverInfoProvider)1 HoverInfoProvider (org.springframework.ide.vscode.commons.languageserver.hover.HoverInfoProvider)1 VscodeHoverEngineAdapter (org.springframework.ide.vscode.commons.languageserver.hover.VscodeHoverEngineAdapter)1 IDocument (org.springframework.ide.vscode.commons.util.text.IDocument)1 YamlHoverInfoProvider (org.springframework.ide.vscode.commons.yaml.hover.YamlHoverInfoProvider)1