org.eclipse.lsp4j.services.TextDocumentService Java Examples

The following examples show how to use org.eclipse.lsp4j.services.TextDocumentService. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AbstractCamelLanguageServerTest.java    From camel-language-server with Apache License 2.0 5 votes vote down vote up
protected CompletableFuture<List<? extends Location>> getReferencesFor(CamelLanguageServer camelLanguageServer, Position position, String uri) {
	TextDocumentService textDocumentService = camelLanguageServer.getTextDocumentService();
	ReferenceParams params = new ReferenceParams();
	params.setPosition(position);
	params.setTextDocument(new TextDocumentIdentifier(uri));
	return textDocumentService.references(params);
}
 
Example #2
Source File: AbstractCamelLanguageServerTest.java    From camel-language-server with Apache License 2.0 5 votes vote down vote up
protected CompletableFuture<Either<List<? extends Location>,List<? extends LocationLink>>> getDefinitionsFor(CamelLanguageServer camelLanguageServer, Position position) {
	TextDocumentService textDocumentService = camelLanguageServer.getTextDocumentService();
	DefinitionParams params = new DefinitionParams();
	params.setPosition(position);
	params.setTextDocument(new TextDocumentIdentifier(DUMMY_URI+extensionUsed));
	return textDocumentService.definition(params);
}
 
Example #3
Source File: ActionScriptLanguageServer.java    From vscode-as3mxml with Apache License 2.0 5 votes vote down vote up
/**
 * Requests from Visual Studio Code that are at the document level. Things
 * like API completion, function signature help, find references.
 */
@Override
public TextDocumentService getTextDocumentService()
{
    if (actionScriptServices == null)
    {
        actionScriptServices = new ActionScriptServices();
    }
    return actionScriptServices;
}
 
Example #4
Source File: DefaultRequestManager.java    From lsp4intellij with Apache License 2.0 5 votes vote down vote up
@Override
public TextDocumentService getTextDocumentService() {
    if (checkStatus()) {
        try {
            return textDocumentService;
        } catch (Exception e) {
            crashed(e);
            return null;
        }
    }
    return null;
}
 
Example #5
Source File: LSPBindings.java    From netbeans with Apache License 2.0 4 votes vote down vote up
public TextDocumentService getTextDocumentService() {
    return server.getTextDocumentService();
}
 
Example #6
Source File: SarosLanguageServer.java    From saros with GNU General Public License v2.0 4 votes vote down vote up
@Override
public TextDocumentService getTextDocumentService() {
  return new DocumentServiceStub();
}
 
Example #7
Source File: NullResponseTest.java    From lsp4j with Eclipse Public License 2.0 4 votes vote down vote up
@Override
public TextDocumentService getTextDocumentService() {
	return null;
}
 
Example #8
Source File: MockLanguageServer.java    From lsp4j with Eclipse Public License 2.0 4 votes vote down vote up
@Override
public TextDocumentService getTextDocumentService() {
	return this;
}
 
Example #9
Source File: RpcMethodTest.java    From lsp4j with Eclipse Public License 2.0 4 votes vote down vote up
@Test public void testCodelensResolve() {
	Map<String, JsonRpcMethod> methods = ServiceEndpoints.getSupportedMethods(TextDocumentService.class);
	Assert.assertNotNull(methods.get("codeLens/resolve"));
	Assert.assertNotNull(methods.get("completionItem/resolve"));
}
 
Example #10
Source File: RpcMethodTest.java    From lsp4j with Eclipse Public License 2.0 4 votes vote down vote up
@Test public void testDocumentSymbol() {
	Map<String, JsonRpcMethod> methods = ServiceEndpoints.getSupportedMethods(TextDocumentService.class);
	JsonRpcMethod jsonRpcMethod = methods.get("textDocument/documentSymbol");
	Assert.assertNotNull(jsonRpcMethod);
}
 
Example #11
Source File: LanguageServerImpl.java    From xtext-core with Eclipse Public License 2.0 4 votes vote down vote up
@Override
public TextDocumentService getTextDocumentService() {
	return this;
}
 
Example #12
Source File: SyntaxLanguageServer.java    From eclipse.jdt.ls with Eclipse Public License 2.0 4 votes vote down vote up
@Override
public TextDocumentService getTextDocumentService() {
	return this;
}
 
Example #13
Source File: JDTLanguageServer.java    From eclipse.jdt.ls with Eclipse Public License 2.0 4 votes vote down vote up
@Override
public TextDocumentService getTextDocumentService() {
	return this;
}
 
Example #14
Source File: TeiidDdlTextDocumentService.java    From syndesis with Apache License 2.0 4 votes vote down vote up
@Override
public CompletableFuture<List<ColorInformation>> documentColor(DocumentColorParams params) {
    return TextDocumentService.super.documentColor(params);
}
 
Example #15
Source File: Server.java    From netbeans with Apache License 2.0 4 votes vote down vote up
@Override
public TextDocumentService getTextDocumentService() {
    return textDocumentService;
}
 
Example #16
Source File: XLanguageServerImpl.java    From n4js with Eclipse Public License 1.0 4 votes vote down vote up
@Override
public TextDocumentService getTextDocumentService() {
	return this;
}
 
Example #17
Source File: RdfLintLanguageServer.java    From rdflint with MIT License 4 votes vote down vote up
@Override
public TextDocumentService getTextDocumentService() {
  return this;
}
 
Example #18
Source File: AbstractCamelLanguageServerTest.java    From camel-language-server with Apache License 2.0 4 votes vote down vote up
protected CompletableFuture<List<Either<SymbolInformation,DocumentSymbol>>> getDocumentSymbolFor(CamelLanguageServer camelLanguageServer) {
	TextDocumentService textDocumentService = camelLanguageServer.getTextDocumentService();
	DocumentSymbolParams params = new DocumentSymbolParams(new TextDocumentIdentifier(DUMMY_URI+extensionUsed));
	return textDocumentService.documentSymbol(params);
}
 
Example #19
Source File: AbstractCamelLanguageServerTest.java    From camel-language-server with Apache License 2.0 4 votes vote down vote up
protected CompletableFuture<Either<List<CompletionItem>, CompletionList>> getCompletionFor(CamelLanguageServer camelLanguageServer, Position position, String filename) {
	TextDocumentService textDocumentService = camelLanguageServer.getTextDocumentService();
	CompletionParams completionParams = new CompletionParams(new TextDocumentIdentifier(filename), position);
	return textDocumentService.completion(completionParams);
}
 
Example #20
Source File: XMLLanguageServer.java    From lemminx with Eclipse Public License 2.0 4 votes vote down vote up
@Override
public TextDocumentService getTextDocumentService() {
	return xmlTextDocumentService;
}
 
Example #21
Source File: GroovyLanguageServer.java    From groovy-language-server with Apache License 2.0 4 votes vote down vote up
@Override
public TextDocumentService getTextDocumentService() {
    return groovyServices;
}