@Test void testCompletion() { openAndAwait(); CompletableFuture<Either<List<CompletionItem>, CompletionList>> completion = service.completion( new CompletionParams( new TextDocumentIdentifier(DOCUMENT_URI), new Position(0, 8))); assertCompletionCorrect(completion); }
@Override public CompletableFuture<Either<List<CompletionItem>, CompletionList>> completion( CompletionParams params) { String uri = params.getTextDocument().getUri(); return CompletableFuture.<Either<List<CompletionItem>, CompletionList>>supplyAsync( () -> Either.forRight(completions.collectFor(docs.get(uri), params))) .whenComplete( reportExceptionIfThrown(createDescriptiveErrorMessage("completion lookup", uri))); }
MyTextDocumentService implements TextDocumentService, EventObserver<RunAnalysisEvent> { @Override public CompletableFuture<Either<List<CompletionItem>, CompletionList>> completion( CompletionParams params) { String uri = params.getTextDocument().getUri(); return CompletableFuture.<Either<List<CompletionItem>, CompletionList>>supplyAsync( () -> Either.forRight(completions.collectFor(docs.get(uri), params))) .whenComplete( reportExceptionIfThrown(createDescriptiveErrorMessage("completion lookup", uri))); } }
MyTextDocumentService implements TextDocumentService, EventObserver<RunAnalysisEvent> { @Override public CompletableFuture<Either<List<CompletionItem>, CompletionList>> completion( CompletionParams params) { String uri = params.getTextDocument().getUri(); return CompletableFuture.<Either<List<CompletionItem>, CompletionList>>supplyAsync( () -> Either.forRight(completions.collectFor(docs.get(uri), params))) .whenComplete( reportExceptionIfThrown(createDescriptiveErrorMessage("completion lookup", uri))); } @Inject @Builder  MyTextDocumentService(
      Communications communications,
      LanguageEngineFacade engine,
      Formations formations,
      Completions completions,
      Occurrences occurrences,
      DataBusBroker dataBus,
      CodeActions actions); }
MyTextDocumentService implements TextDocumentService, EventObserver<RunAnalysisEvent> { @Override public CompletableFuture<Either<List<CompletionItem>, CompletionList>> completion( CompletionParams params) { String uri = params.getTextDocument().getUri(); return CompletableFuture.<Either<List<CompletionItem>, CompletionList>>supplyAsync( () -> Either.forRight(completions.collectFor(docs.get(uri), params))) .whenComplete( reportExceptionIfThrown(createDescriptiveErrorMessage("completion lookup", uri))); } @Inject @Builder  MyTextDocumentService(
      Communications communications,
      LanguageEngineFacade engine,
      Formations formations,
      Completions completions,
      Occurrences occurrences,
      DataBusBroker dataBus,
      CodeActions actions); @Override CompletableFuture<Either<List<CompletionItem>, CompletionList>> completion(
      CompletionParams params); @Override CompletableFuture<CompletionItem> resolveCompletionItem(CompletionItem unresolved); @Override CompletableFuture<List<? extends Location>> definition(
      TextDocumentPositionParams position); @Override CompletableFuture<List<? extends Location>> references(ReferenceParams params); @Override CompletableFuture<List<? extends DocumentHighlight>> documentHighlight(
      TextDocumentPositionParams position); @Override CompletableFuture<List<? extends TextEdit>> formatting(DocumentFormattingParams params); @Override CompletableFuture<List<Either<Command, CodeAction>>> codeAction(CodeActionParams params); @Override void didOpen(DidOpenTextDocumentParams params); @Override void didChange(DidChangeTextDocumentParams params); @Override void didClose(DidCloseTextDocumentParams params); @Override void didSave(DidSaveTextDocumentParams params); @Override void observerCallback(@Nonnull RunAnalysisEvent event); @Override CompletableFuture<List<Either<SymbolInformation, DocumentSymbol>>> documentSymbol(DocumentSymbolParams params); }
MyTextDocumentService implements TextDocumentService, EventObserver<RunAnalysisEvent> { @Override public CompletableFuture<Either<List<CompletionItem>, CompletionList>> completion( CompletionParams params) { String uri = params.getTextDocument().getUri(); return CompletableFuture.<Either<List<CompletionItem>, CompletionList>>supplyAsync( () -> Either.forRight(completions.collectFor(docs.get(uri), params))) .whenComplete( reportExceptionIfThrown(createDescriptiveErrorMessage("completion lookup", uri))); } @Inject @Builder  MyTextDocumentService(
      Communications communications,
      LanguageEngineFacade engine,
      Formations formations,
      Completions completions,
      Occurrences occurrences,
      DataBusBroker dataBus,
      CodeActions actions); @Override CompletableFuture<Either<List<CompletionItem>, CompletionList>> completion(
      CompletionParams params); @Override CompletableFuture<CompletionItem> resolveCompletionItem(CompletionItem unresolved); @Override CompletableFuture<List<? extends Location>> definition(
      TextDocumentPositionParams position); @Override CompletableFuture<List<? extends Location>> references(ReferenceParams params); @Override CompletableFuture<List<? extends DocumentHighlight>> documentHighlight(
      TextDocumentPositionParams position); @Override CompletableFuture<List<? extends TextEdit>> formatting(DocumentFormattingParams params); @Override CompletableFuture<List<Either<Command, CodeAction>>> codeAction(CodeActionParams params); @Override void didOpen(DidOpenTextDocumentParams params); @Override void didChange(DidChangeTextDocumentParams params); @Override void didClose(DidCloseTextDocumentParams params); @Override void didSave(DidSaveTextDocumentParams params); @Override void observerCallback(@Nonnull RunAnalysisEvent event); @Override CompletableFuture<List<Either<SymbolInformation, DocumentSymbol>>> documentSymbol(DocumentSymbolParams params);  }