本文整理汇总了Java中org.eclipse.lsp4j.services.TextDocumentService类的典型用法代码示例。如果您正苦于以下问题:Java TextDocumentService类的具体用法?Java TextDocumentService怎么用?Java TextDocumentService使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TextDocumentService类属于org.eclipse.lsp4j.services包,在下文中一共展示了TextDocumentService类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getCompletionFor
import org.eclipse.lsp4j.services.TextDocumentService; //导入依赖的package包/类
protected CompletableFuture<Either<List<CompletionItem>, CompletionList>> getCompletionFor(CamelLanguageServer camelLanguageServer, Position position) {
TextDocumentService textDocumentService = camelLanguageServer.getTextDocumentService();
TextDocumentPositionParams dummyCompletionPositionRequest = new TextDocumentPositionParams(new TextDocumentIdentifier(DUMMY_URI), position);
CompletableFuture<Either<List<CompletionItem>, CompletionList>> completions = textDocumentService.completion(dummyCompletionPositionRequest);
return completions;
}
示例2: getTextDocumentService
import org.eclipse.lsp4j.services.TextDocumentService; //导入依赖的package包/类
/**
* @return the textDocumentService
*/
public TextDocumentService getTextDocumentService() {
return this.textDocumentService;
}
示例3: setTextDocumentService
import org.eclipse.lsp4j.services.TextDocumentService; //导入依赖的package包/类
/**
* @param textDocumentService the textDocumentService to set
*/
protected void setTextDocumentService(TextDocumentService textDocumentService) {
this.textDocumentService = textDocumentService;
}
示例4: getTextDocumentService
import org.eclipse.lsp4j.services.TextDocumentService; //导入依赖的package包/类
@Override
public TextDocumentService getTextDocumentService() {
return textDocuments;
}
示例5: getTextDocumentService
import org.eclipse.lsp4j.services.TextDocumentService; //导入依赖的package包/类
@Override
public TextDocumentService getTextDocumentService() {
// TODO: perhaps break this out into separate object
return this;
}
示例6: getTextDocumentService
import org.eclipse.lsp4j.services.TextDocumentService; //导入依赖的package包/类
@Override
public TextDocumentService getTextDocumentService() {
return this;
}
示例7: getTextDocumentService
import org.eclipse.lsp4j.services.TextDocumentService; //导入依赖的package包/类
@Override
public TextDocumentService getTextDocumentService() {
return this;
}
示例8: testDocumentSymbol
import org.eclipse.lsp4j.services.TextDocumentService; //导入依赖的package包/类
@Test public void testDocumentSymbol() {
Map<String, JsonRpcMethod> methods = ServiceEndpoints.getSupportedMethods(TextDocumentService.class);
JsonRpcMethod jsonRpcMethod = methods.get("textDocument/documentSymbol");
Assert.assertNotNull(jsonRpcMethod);
}
示例9: testCodelensResolve
import org.eclipse.lsp4j.services.TextDocumentService; //导入依赖的package包/类
@Test public void testCodelensResolve() {
Map<String, JsonRpcMethod> methods = ServiceEndpoints.getSupportedMethods(TextDocumentService.class);
Assert.assertNotNull(methods.get("codeLens/resolve"));
Assert.assertNotNull(methods.get("completionItem/resolve"));
}
示例10: getTextDocumentService
import org.eclipse.lsp4j.services.TextDocumentService; //导入依赖的package包/类
@Override
public TextDocumentService getTextDocumentService() {
return null;
}
示例11: setUp
import org.eclipse.lsp4j.services.TextDocumentService; //导入依赖的package包/类
@BeforeMethod
public void setUp() throws Exception {
this.serverCapabilities = new ServerCapabilities();
serverDescription =
new LanguageServerDescription(
"foo", Collections.singletonList("id"), Collections.emptyList());
initializeResult = new InitializeResult(serverCapabilities);
completableFuture = completedFuture(initializeResult);
when(languageServerLauncher.isAbleToLaunch()).thenReturn(true);
when(languageServerLauncher.getDescription()).thenReturn(serverDescription);
when(languageServerLauncher.isLocal()).thenReturn(true);
when(languageDescription.getLanguageId()).thenReturn("id");
when(languageDescription.getFileExtensions()).thenReturn(Collections.singletonList("txt"));
when(languageDescription.getMimeType()).thenReturn("plain/text");
when(languageServer.getTextDocumentService()).thenReturn(mock(TextDocumentService.class));
when(languageServer.initialize(any(InitializeParams.class))).thenReturn(completableFuture);
when(languageRecognizer.recognizeByPath(anyString())).thenReturn(languageDescription);
when(languageRecognizer.recognizeById(anyString())).thenReturn(languageDescription);
when(pmp.get()).thenReturn(pm);
when(clientFactory.create(anyString())).thenReturn(languageClient);
when(httpJsonRequestFactory.fromUrl(any(String.class))).thenReturn(httpJsonRequest);
when(httpJsonRequest.useGetMethod()).thenReturn(httpJsonRequest);
when(httpJsonRequest.request()).thenReturn(httpJsonResponse);
when(httpJsonResponse.asDto(any())).thenReturn(workspace);
registry =
spy(
new LanguageServerRegistryImpl(
"",
"",
httpJsonRequestFactory,
new HashSet<>(),
Collections.singleton(languageServerLauncher),
Collections.singleton(languageDescription),
pmp,
initializer,
null,
clientFactory,
languageRecognizer) {
@Override
protected String extractProjectPath(String filePath) throws LanguageServerException {
return PROJECT_PATH;
}
});
when(initializer.initialize(
any(LanguageServerLauncher.class), any(LanguageClient.class), anyString()))
.thenAnswer(invocation -> completedFuture(Pair.of(languageServer, initializeResult)));
}
示例12: getTextDocumentService
import org.eclipse.lsp4j.services.TextDocumentService; //导入依赖的package包/类
@Override
public TextDocumentService getTextDocumentService() {
return textDocumentService;
}