public void setImplementationProvider(final StaticRegistrationOptions implementationProvider) { if (implementationProvider == null) { this.implementationProvider = null; return; } this.implementationProvider = Either.forRight(implementationProvider); }
public void setDocumentation(final String documentation) { if (documentation == null) { this.documentation = null; return; } this.documentation = Either.forLeft(documentation); }
private static Boolean getCodeActionProvider(ServerCapabilities cap) { Either<Boolean, CodeActionOptions> codeActionProvider = cap.getCodeActionProvider(); if (codeActionProvider == null) { return false; } if (codeActionProvider.isRight()) { return codeActionProvider.getRight() != null; } else { return codeActionProvider.getLeft(); } }
protected Either<String, MarkedString> toContents(final String language, final String value) { if ((language == null)) { return Either.<String, MarkedString>forLeft(value); } MarkedString _markedString = new MarkedString(language, value); return Either.<String, MarkedString>forRight(_markedString); }
private TextDocumentSyncKind getDocumentSyncMode() { if (initResult!=null) { Either<TextDocumentSyncKind, TextDocumentSyncOptions> mode = initResult.getCapabilities().getTextDocumentSync(); if (mode.isLeft()) { return mode.getLeft(); } else { throw new IllegalStateException("Harness doesn't support fancy Sync options yet!"); } } return TextDocumentSyncKind.None; }
@Override public boolean equals(final Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; CancelParams other = (CancelParams) obj; if (this.id == null) { if (other.id != null) return false; } else if (!this.id.equals(other.id)) return false; return true; }
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((this.id == null) ? 0 : this.id.hashCode()); return result; }
public T3 getThird() { Either<T2, T3> right = getRight(); if (right == null) return null; else return right.getRight(); }
public T2 getSecond() { Either<T2, T3> right = getRight(); if (right == null) return null; else return right.getLeft(); }
public boolean isSecond() { return isRight() && getRight().isLeft(); }
public boolean isThird() { return isRight() && getRight().isRight(); }
@Override public boolean handleResult( ExtendedLanguageServer element, List<Either<Command, CodeAction>> res) { for (Either<Command, CodeAction> cmd : res) { if (cmd.isLeft()) { result.add(new CommandDto(cmd.getLeft())); } else { // see https://github.com/eclipse/che/issues/11140 LOG.warn("Ignoring code action: {}", cmd.getRight()); } } return false; } };
@Override public boolean equals(final Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; CancelParams other = (CancelParams) obj; if (this.id == null) { if (other.id != null) return false; } else if (!this.id.equals(other.id)) return false; return true; }