use of org.eclipse.lsp4j.CodeLensParams in project eclipse.jdt.ls by eclipse.
the class CodeLensHandlerTest method testGetCodeLenseBoundaries.
@Test
public void testGetCodeLenseBoundaries() {
List<CodeLens> result = handler.getCodeLensSymbols(null, monitor);
assertNotNull(result);
assertEquals(0, result.size());
String payload = createCodeLensSymbolsRequest("src/java/Missing.java");
CodeLensParams codeLensParams = getParams(payload);
String uri = codeLensParams.getTextDocument().getUri();
result = handler.getCodeLensSymbols(uri, monitor);
assertEquals(0, result.size());
}
use of org.eclipse.lsp4j.CodeLensParams in project eclipse.jdt.ls by eclipse.
the class CodeLensHandlerTest method testDisableCodeLensSymbols.
@Test
public void testDisableCodeLensSymbols() throws Exception {
Preferences noCodeLenses = Preferences.createFrom(Collections.singletonMap(Preferences.REFERENCES_CODE_LENS_ENABLED_KEY, "false"));
Mockito.reset(preferenceManager);
when(preferenceManager.getPreferences()).thenReturn(noCodeLenses);
handler = new CodeLensHandler(preferenceManager);
String payload = createCodeLensSymbolsRequest("src/java/IFoo.java");
CodeLensParams codeLensParams = getParams(payload);
String uri = codeLensParams.getTextDocument().getUri();
assertFalse(uri.isEmpty());
// when
List<CodeLens> result = handler.getCodeLensSymbols(uri, monitor);
// then
assertEquals(0, result.size());
}
use of org.eclipse.lsp4j.CodeLensParams in project eclipse.jdt.ls by eclipse.
the class CodeLensHandlerTest method testDisableImplementationsCodeLensSymbols.
@Test
public void testDisableImplementationsCodeLensSymbols() throws Exception {
Preferences noImplementationsCodeLenses = Preferences.createFrom(Collections.singletonMap(Preferences.IMPLEMENTATIONS_CODE_LENS_ENABLED_KEY, "false"));
Mockito.reset(preferenceManager);
when(preferenceManager.getPreferences()).thenReturn(noImplementationsCodeLenses);
Preferences noReferencesCodeLenses = Preferences.createFrom(Collections.singletonMap(Preferences.REFERENCES_CODE_LENS_ENABLED_KEY, "false"));
Mockito.reset(preferenceManager);
when(preferenceManager.getPreferences()).thenReturn(noReferencesCodeLenses);
handler = new CodeLensHandler(preferenceManager);
String payload = createCodeLensSymbolsRequest("src/java/IFoo.java");
CodeLensParams codeLensParams = getParams(payload);
String uri = codeLensParams.getTextDocument().getUri();
assertFalse(uri.isEmpty());
// when
List<CodeLens> result = handler.getCodeLensSymbols(uri, monitor);
// then
assertEquals(0, result.size());
}
use of org.eclipse.lsp4j.CodeLensParams in project sts4 by spring-projects.
the class LanguageServerHarness method getCodeLenses.
public List<? extends CodeLens> getCodeLenses(TextDocumentInfo document) throws Exception {
CodeLensParams params = new CodeLensParams();
params.setTextDocument(document.getId());
return getServer().getTextDocumentService().codeLens(params).get();
}
Aggregations