use of org.springframework.ide.vscode.commons.languageserver.hover.VscodeHoverEngineAdapter 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);
}
Aggregations