本文整理汇总了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;
}
开发者ID:lhein,项目名称:camel-language-server,代码行数:8,代码来源:AbstractCamelLanguageServerTest.java
示例2: getTextDocumentService
import org.eclipse.lsp4j.services.TextDocumentService; //导入依赖的package包/类
/**
* @return the textDocumentService
*/
public TextDocumentService getTextDocumentService() {
return this.textDocumentService;
}
开发者ID:lhein,项目名称:camel-language-server,代码行数:7,代码来源:AbstractLanguageServer.java
示例3: setTextDocumentService
import org.eclipse.lsp4j.services.TextDocumentService; //导入依赖的package包/类
/**
* @param textDocumentService the textDocumentService to set
*/
protected void setTextDocumentService(TextDocumentService textDocumentService) {
this.textDocumentService = textDocumentService;
}
开发者ID:lhein,项目名称:camel-language-server,代码行数:7,代码来源:AbstractLanguageServer.java
示例4: getTextDocumentService
import org.eclipse.lsp4j.services.TextDocumentService; //导入依赖的package包/类
@Override
public TextDocumentService getTextDocumentService() {
return textDocuments;
}
开发者ID:georgewfraser,项目名称:vscode-javac,代码行数:5,代码来源:JavaLanguageServer.java
示例5: getTextDocumentService
import org.eclipse.lsp4j.services.TextDocumentService; //导入依赖的package包/类
@Override
public TextDocumentService getTextDocumentService() {
// TODO: perhaps break this out into separate object
return this;
}
开发者ID:smarr,项目名称:SOMns-vscode,代码行数:6,代码来源:SomLanguageServer.java
示例6: getTextDocumentService
import org.eclipse.lsp4j.services.TextDocumentService; //导入依赖的package包/类
@Override
public TextDocumentService getTextDocumentService() {
return this;
}
开发者ID:eclipse,项目名称:eclipse.jdt.ls,代码行数:5,代码来源:JDTLanguageServer.java
示例7: getTextDocumentService
import org.eclipse.lsp4j.services.TextDocumentService; //导入依赖的package包/类
@Override
public TextDocumentService getTextDocumentService() {
return this;
}
开发者ID:eclipse,项目名称:xtext-core,代码行数:5,代码来源:LanguageServerImpl.java
示例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);
}
开发者ID:eclipse,项目名称:lsp4j,代码行数:6,代码来源:RpcMethodTest.java
示例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"));
}
开发者ID:eclipse,项目名称:lsp4j,代码行数:6,代码来源:RpcMethodTest.java
示例10: getTextDocumentService
import org.eclipse.lsp4j.services.TextDocumentService; //导入依赖的package包/类
@Override
public TextDocumentService getTextDocumentService() {
return null;
}
开发者ID:eclipse,项目名称:lsp4j,代码行数:5,代码来源:NullResponseTest.java
示例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)));
}
开发者ID:eclipse,项目名称:che,代码行数:58,代码来源:LanguageServerRegistryImplTest.java
示例12: getTextDocumentService
import org.eclipse.lsp4j.services.TextDocumentService; //导入依赖的package包/类
@Override
public TextDocumentService getTextDocumentService() {
return textDocumentService;
}
开发者ID:eclipse,项目名称:che,代码行数:5,代码来源:MavenLanguageServer.java
注:本文中的org.eclipse.lsp4j.services.TextDocumentService类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论