@Override
    public CompletableFuture<Either<List<CompletionItem>, CompletionList>> completion(CompletionParams completionParams) {
        // Provide completion item.
        return CompletableFutures.computeAsync((cancelChecker) -> {
            try {

                ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
                PrintStream errorLogger = new PrintStream(outputStream);
                Either<List<CompletionItem>, CompletionList> result =
                    Either.forLeft(CommonCompletion.getCompletionItems(eventContextCreator.createContext(completionParams), errorLogger));

                if (outputStream.size() > 0) {
                    schemaMessageHandler.logMessage(MessageType.Error, 
                        "Completion failed with errors: " + outputStream.toString() 
                    );
                }
                return result;
            } catch(CancellationException ignore) {
                // Ignore
            } catch(InvalidContextException ignore) {
                // Ignore
            }

            // Return the list of completion items.
            return Either.forLeft(new ArrayList<>());
        });
    }
SchemaTextDocumentService handles incomming requests from the client.
integration/schema-language-server/language-server/src/main/java/ai/vespa/schemals/SchemaTextDocumentService.java