Search in sources :

Example 1 with CommandKindCapabilities

use of com.redhat.qute.ls.commons.client.CommandKindCapabilities in project quarkus-ls by redhat-developer.

the class QuteAssert method testCodeLensFor.

private static void testCodeLensFor(String value, String fileUri, String templateId, String projectUri, String templateBaseDir, CodeLens... expected) throws Exception {
    QuteProjectRegistry projectRegistry = new MockQuteProjectRegistry();
    Template template = createTemplate(value, fileUri, projectUri, templateBaseDir, projectRegistry);
    template.setTemplateId(templateId);
    QuteLanguageService languageService = new QuteLanguageService(new JavaDataModelCache(projectRegistry));
    SharedSettings sharedSettings = new SharedSettings();
    CommandCapabilities commandCapabilities = new CommandCapabilities();
    CommandKindCapabilities kinds = new CommandKindCapabilities(Arrays.asList(QuteClientCommandConstants.COMMAND_JAVA_DEFINITION));
    commandCapabilities.setCommandKind(kinds);
    sharedSettings.getCommandCapabilities().setCapabilities(commandCapabilities);
    List<? extends CodeLens> actual = languageService.getCodeLens(template, sharedSettings, () -> {
    }).get();
    assertCodeLens(actual, expected);
}
Also used : JavaDataModelCache(com.redhat.qute.project.datamodel.JavaDataModelCache) SharedSettings(com.redhat.qute.settings.SharedSettings) QuteProjectRegistry(com.redhat.qute.project.QuteProjectRegistry) MockQuteProjectRegistry(com.redhat.qute.project.MockQuteProjectRegistry) CommandCapabilities(com.redhat.qute.ls.commons.client.CommandCapabilities) QuteLanguageService(com.redhat.qute.services.QuteLanguageService) CommandKindCapabilities(com.redhat.qute.ls.commons.client.CommandKindCapabilities) MockQuteProjectRegistry(com.redhat.qute.project.MockQuteProjectRegistry) Template(com.redhat.qute.parser.template.Template)

Example 2 with CommandKindCapabilities

use of com.redhat.qute.ls.commons.client.CommandKindCapabilities in project quarkus-ls by redhat-developer.

the class QuteCodeActionWithSettingsTest method createSharedSettings.

private static SharedSettings createSharedSettings(String... commandIds) {
    SharedSettings settings = new SharedSettings();
    CommandCapabilities commandCapabilities = new CommandCapabilities();
    CommandKindCapabilities kinds = new CommandKindCapabilities(commandIds != null ? Arrays.asList(commandIds) : Collections.emptyList());
    commandCapabilities.setCommandKind(kinds);
    settings.getCommandCapabilities().setCapabilities(commandCapabilities);
    return settings;
}
Also used : SharedSettings(com.redhat.qute.settings.SharedSettings) CommandCapabilities(com.redhat.qute.ls.commons.client.CommandCapabilities) CommandKindCapabilities(com.redhat.qute.ls.commons.client.CommandKindCapabilities)

Aggregations

CommandCapabilities (com.redhat.qute.ls.commons.client.CommandCapabilities)2 CommandKindCapabilities (com.redhat.qute.ls.commons.client.CommandKindCapabilities)2 SharedSettings (com.redhat.qute.settings.SharedSettings)2 Template (com.redhat.qute.parser.template.Template)1 MockQuteProjectRegistry (com.redhat.qute.project.MockQuteProjectRegistry)1 QuteProjectRegistry (com.redhat.qute.project.QuteProjectRegistry)1 JavaDataModelCache (com.redhat.qute.project.datamodel.JavaDataModelCache)1 QuteLanguageService (com.redhat.qute.services.QuteLanguageService)1