Search in sources :

Example 1 with InitializedParams

use of org.eclipse.lsp4j.InitializedParams in project eclipse.jdt.ls by eclipse.

the class InitHandlerTest method testRegisterDelayedCapability.

@Test
public void testRegisterDelayedCapability() throws Exception {
    ClientPreferences mockCapabilies = mock(ClientPreferences.class);
    when(preferenceManager.getClientPreferences()).thenReturn(mockCapabilies);
    when(mockCapabilies.isDocumentSymbolDynamicRegistered()).thenReturn(Boolean.TRUE);
    when(mockCapabilies.isWorkspaceSymbolDynamicRegistered()).thenReturn(Boolean.TRUE);
    when(mockCapabilies.isDocumentSymbolDynamicRegistered()).thenReturn(Boolean.TRUE);
    when(mockCapabilies.isCodeActionDynamicRegistered()).thenReturn(Boolean.TRUE);
    when(mockCapabilies.isDefinitionDynamicRegistered()).thenReturn(Boolean.TRUE);
    when(mockCapabilies.isHoverDynamicRegistered()).thenReturn(Boolean.TRUE);
    when(mockCapabilies.isReferencesDynamicRegistered()).thenReturn(Boolean.TRUE);
    when(mockCapabilies.isDocumentHighlightDynamicRegistered()).thenReturn(Boolean.TRUE);
    InitializeResult result = initialize(true);
    assertNull(result.getCapabilities().getDocumentSymbolProvider());
    server.initialized(new InitializedParams());
    verify(client, times(7)).registerCapability(any());
}
Also used : InitializeResult(org.eclipse.lsp4j.InitializeResult) ClientPreferences(org.eclipse.jdt.ls.core.internal.preferences.ClientPreferences) InitializedParams(org.eclipse.lsp4j.InitializedParams) AbstractProjectsManagerBasedTest(org.eclipse.jdt.ls.core.internal.managers.AbstractProjectsManagerBasedTest) Test(org.junit.Test)

Aggregations

AbstractProjectsManagerBasedTest (org.eclipse.jdt.ls.core.internal.managers.AbstractProjectsManagerBasedTest)1 ClientPreferences (org.eclipse.jdt.ls.core.internal.preferences.ClientPreferences)1 InitializeResult (org.eclipse.lsp4j.InitializeResult)1 InitializedParams (org.eclipse.lsp4j.InitializedParams)1 Test (org.junit.Test)1