use of org.eclipse.lsp4j.TextDocumentSyncKind in project eclipse.jdt.ls by eclipse.
the class InitHandlerTest method testWillSaveAndWillSaveWaitUntilCapabilities.
@Test
public void testWillSaveAndWillSaveWaitUntilCapabilities() throws Exception {
ClientPreferences mockCapabilies = mock(ClientPreferences.class);
when(mockCapabilies.isExecuteCommandDynamicRegistrationSupported()).thenReturn(Boolean.TRUE);
when(preferenceManager.getClientPreferences()).thenReturn(mockCapabilies);
when(mockCapabilies.isWillSaveRegistered()).thenReturn(Boolean.TRUE);
when(mockCapabilies.isWillSaveWaitUntilRegistered()).thenReturn(Boolean.TRUE);
InitializeResult result = initialize(true);
Either<TextDocumentSyncKind, TextDocumentSyncOptions> o = result.getCapabilities().getTextDocumentSync();
assertTrue(o.isRight());
assertTrue(o.getRight().getWillSave());
assertTrue(o.getRight().getWillSaveWaitUntil());
}
Aggregations