private DocumentOnTypeFormattingOptions getDocumentOnTypeFormattingProvider() { DocumentOnTypeFormattingOptions leftOptions = left.getDocumentOnTypeFormattingProvider(); DocumentOnTypeFormattingOptions rightOptions = right.getDocumentOnTypeFormattingProvider(); if (leftOptions == null) { return rightOptions; } if (rightOptions == null) { return leftOptions; } DocumentOnTypeFormattingOptions result = new DocumentOnTypeFormattingOptions(); List<String> triggerChars = new ArrayList<>(); result.setFirstTriggerCharacter(leftOptions.getFirstTriggerCharacter()); triggerChars.addAll(listish(leftOptions.getMoreTriggerCharacter())); triggerChars.addAll(listish(rightOptions.getMoreTriggerCharacter())); result.setMoreTriggerCharacter(triggerChars); return result; }
capabilities.setDocumentOnTypeFormattingProvider(new DocumentOnTypeFormattingOptions(";", Arrays.asList("\n", "}")));
new DocumentOnTypeFormattingOptions(";", Arrays.asList("\n", "}")));