From 296a67b2c5c63fc9fc8ba9ef2d94397df0b8a974 Mon Sep 17 00:00:00 2001 From: Jinbo Wang Date: Fri, 13 Dec 2019 16:52:06 +0800 Subject: [PATCH 1/2] Update call hierarchy for lsp4j Signed-off-by: Jinbo Wang --- .../java/org/eclipse/lsp4j/Protocol.xtend | 77 +++++++--- .../java/org/eclipse/lsp4j/SymbolTag.java | 32 ++++ .../lsp4j/services/TextDocumentService.java | 44 ++++-- .../org/eclipse/lsp4j/CallHierarchyCall.java | 141 ------------------ .../lsp4j/CallHierarchyIncomingCall.java | 110 ++++++++++++++ .../CallHierarchyIncomingCallsParams.java | 67 +++++++++ ...rchySymbol.java => CallHierarchyItem.java} | 63 +++++--- .../lsp4j/CallHierarchyOutgoingCall.java | 113 ++++++++++++++ .../CallHierarchyOutgoingCallsParams.java | 67 +++++++++ ...s.java => CallHierarchyPrepareParams.java} | 38 +---- 10 files changed, 523 insertions(+), 229 deletions(-) create mode 100644 org.eclipse.lsp4j/src/main/java/org/eclipse/lsp4j/SymbolTag.java delete mode 100644 org.eclipse.lsp4j/src/main/xtend-gen/org/eclipse/lsp4j/CallHierarchyCall.java create mode 100644 org.eclipse.lsp4j/src/main/xtend-gen/org/eclipse/lsp4j/CallHierarchyIncomingCall.java create mode 100644 org.eclipse.lsp4j/src/main/xtend-gen/org/eclipse/lsp4j/CallHierarchyIncomingCallsParams.java rename org.eclipse.lsp4j/src/main/xtend-gen/org/eclipse/lsp4j/{CallHierarchySymbol.java => CallHierarchyItem.java} (78%) create mode 100644 org.eclipse.lsp4j/src/main/xtend-gen/org/eclipse/lsp4j/CallHierarchyOutgoingCall.java create mode 100644 org.eclipse.lsp4j/src/main/xtend-gen/org/eclipse/lsp4j/CallHierarchyOutgoingCallsParams.java rename org.eclipse.lsp4j/src/main/xtend-gen/org/eclipse/lsp4j/{CallHierarchyParams.java => CallHierarchyPrepareParams.java} (53%) diff --git a/org.eclipse.lsp4j/src/main/java/org/eclipse/lsp4j/Protocol.xtend b/org.eclipse.lsp4j/src/main/java/org/eclipse/lsp4j/Protocol.xtend index dd954bb6b..2f7874c58 100644 --- a/org.eclipse.lsp4j/src/main/java/org/eclipse/lsp4j/Protocol.xtend +++ b/org.eclipse.lsp4j/src/main/java/org/eclipse/lsp4j/Protocol.xtend @@ -4850,45 +4850,69 @@ class SemanticHighlightingInformation { } /** - * Returns a collection of calls from one symbol to another. + * The parameter of a `textDocument/prepareCallHierarchy` request. */ @Beta @JsonRpcData -class CallHierarchyParams extends TextDocumentPositionParams { +class CallHierarchyPrepareParams extends TextDocumentPositionParams { - /** - * The direction of calls to provide. - */ - @NonNull - CallHierarchyDirection direction +} +/** + * The parameter of a `callHierarchy/incomingCalls` request. + */ +@Beta +@JsonRpcData +class CallHierarchyIncomingCallsParams { + CallHierarchyItem item } /** - * Each {@code CallHierarchyCall} object defines a call from one {@code CallHierarchySymbol} to another. + * The parameter of a `callHierarchy/outgoingCalls` request. */ @Beta @JsonRpcData -class CallHierarchyCall { +class CallHierarchyOutgoingCallsParams { + CallHierarchyItem item +} + +/** + * Represents an incoming call, e.g. a caller of a method or constructor. + */ +@Beta +@JsonRpcData +class CallHierarchyIncomingCall { /** - * The source range of the reference. The range is a sub range of the {@link CallHierarchyCall#getFrom from} symbol range. + * The item that makes the call. */ - @NonNull - Range range + CallHierarchyItem from /** - * The symbol that contains the reference. + * The range at which at which the calls appears. This is relative to the caller + * denoted by [`this.from`](#CallHierarchyIncomingCall.from). */ - @NonNull - CallHierarchySymbol from + Range[] fromRanges +} + +/** + * Represents an outgoing call, e.g. calling a getter from a method or a method from a constructor etc. + */ +@Beta +@JsonRpcData +class CallHierarchyOutgoingCall { /** - * The symbol that is referenced. + * The item that is called. */ - @NonNull - CallHierarchySymbol to + CallHierarchyItem to + /** + * The range at which this item is called. This is the range relative to the caller, e.g the item + * passed to [`provideCallHierarchyOutgoingCalls`](#CallHierarchyItemProvider.provideCallHierarchyOutgoingCalls) + * and not [`this.to`](#CallHierarchyOutgoingCall.to). + */ + Range[] fromRanges } /** @@ -4896,27 +4920,32 @@ class CallHierarchyCall { */ @Beta @JsonRpcData -class CallHierarchySymbol { +class CallHierarchyItem { /** - * The name of the symbol targeted by the call hierarchy request. + * The name of the item targeted by the call hierarchy request. */ @NonNull String name /** - * More detail for this symbol, e.g the signature of a function. + * More detail for this item, e.g the signature of a function. */ String detail /** - * The kind of this symbol. + * The kind of this item. */ @NonNull SymbolKind kind /** - * URI of the document containing the symbol. + * Tags for this item. + */ + SymbolTag[] tags + + /** + * The resource identifier of this item. */ @NonNull String uri @@ -4931,7 +4960,7 @@ class CallHierarchySymbol { /** * The range that should be selected and revealed when this symbol is being picked, e.g the name of a function. - * Must be contained by the the {@link CallHierarchySymbol#getRange range}. + * Must be contained by the the {@link CallHierarchyItem#getRange range}. */ @NonNull Range selectionRange diff --git a/org.eclipse.lsp4j/src/main/java/org/eclipse/lsp4j/SymbolTag.java b/org.eclipse.lsp4j/src/main/java/org/eclipse/lsp4j/SymbolTag.java new file mode 100644 index 000000000..ee5f14e35 --- /dev/null +++ b/org.eclipse.lsp4j/src/main/java/org/eclipse/lsp4j/SymbolTag.java @@ -0,0 +1,32 @@ +/****************************************************************************** + * Copyright (c) 2019 Microsoft Corporation and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0, + * or the Eclipse Distribution License v. 1.0 which is available at + * http://www.eclipse.org/org/documents/edl-v10.php. + * + * SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause + ******************************************************************************/ + +package org.eclipse.lsp4j; + +/** + * Symbol tags are extra annotations that tweak the rendering of a symbol. + * @since 3.15 + */ +public enum SymbolTag { + + Deprecated(1); + + private final int value; + + SymbolTag(int value) { + this.value = value; + } + + public int getValue() { + return value; + } +} \ No newline at end of file diff --git a/org.eclipse.lsp4j/src/main/java/org/eclipse/lsp4j/services/TextDocumentService.java b/org.eclipse.lsp4j/src/main/java/org/eclipse/lsp4j/services/TextDocumentService.java index 5cfb3974b..02f29a70b 100644 --- a/org.eclipse.lsp4j/src/main/java/org/eclipse/lsp4j/services/TextDocumentService.java +++ b/org.eclipse.lsp4j/src/main/java/org/eclipse/lsp4j/services/TextDocumentService.java @@ -14,9 +14,12 @@ import java.util.List; import java.util.concurrent.CompletableFuture; -import org.eclipse.lsp4j.CallHierarchyCall; -import org.eclipse.lsp4j.CallHierarchyParams; -import org.eclipse.lsp4j.CallHierarchySymbol; +import org.eclipse.lsp4j.CallHierarchyIncomingCall; +import org.eclipse.lsp4j.CallHierarchyIncomingCallsParams; +import org.eclipse.lsp4j.CallHierarchyOutgoingCall; +import org.eclipse.lsp4j.CallHierarchyOutgoingCallsParams; +import org.eclipse.lsp4j.CallHierarchyPrepareParams; +import org.eclipse.lsp4j.CallHierarchyItem; import org.eclipse.lsp4j.CodeAction; import org.eclipse.lsp4j.CodeActionParams; import org.eclipse.lsp4j.CodeLens; @@ -469,21 +472,38 @@ default CompletableFuture resolveTypeHierarchy(ResolveTypeHie } /** - * The {@code textDocument/callHierarchy} request is sent from the client to the - * server to request the call hierarchy for a symbol defined (or referenced) at - * the given text document position. Returns a collection of calls from one - * symbol to another. The server will send a collection of - * {@link CallHierarchyCall} objects, or {@code null} if no callable symbol is - * found at the given document position. Each {@code CallHierarchyCall} object - * defines a call from one {@link CallHierarchySymbol} to another. + * Bootstraps call hierarchy by returning the item that is denoted by the given document + * and position. This item will be used as entry into the call graph. Providers should + * return null when there is no item at the given location. */ @Beta @JsonRequest - default CompletableFuture> callHierarchy(CallHierarchyParams params) { + default CompletableFuture> prepareCallHierarchy(CallHierarchyPrepareParams params) { + throw new UnsupportedOperationException(); + } + + /** + * Provide all incoming calls for an item, e.g all callers for a method. In graph terms this descibes directed + * and annotated edges inside the call graph, e.g the given item is the starting node and the result is the nodes + * that can be reached. + */ + @Beta + @JsonRequest(value="callHierarchy/incomingCalls", useSegment = false) + default CompletableFuture> callHierarchyIncomingCalls(CallHierarchyIncomingCallsParams params) { + throw new UnsupportedOperationException(); + } + + /** + * Provide all outgoing calls for an item, e.g call calls to functions, methods, or constructors from the given item. In + * graph terms this descibes directed and annotated edges inside the call graph, e.g the given item is the starting + * node and the result is the nodes that can be reached. + */ + @Beta + @JsonRequest(value="callHierarchy/outgoingCalls", useSegment = false) + default CompletableFuture> callHierarchyOutgoingCalls(CallHierarchyOutgoingCallsParams params) { throw new UnsupportedOperationException(); } - /** * The {@code textDocument/selectionRange} request is sent from the client to the server to return * suggested selection ranges at an array of given positions. A selection range is a range around diff --git a/org.eclipse.lsp4j/src/main/xtend-gen/org/eclipse/lsp4j/CallHierarchyCall.java b/org.eclipse.lsp4j/src/main/xtend-gen/org/eclipse/lsp4j/CallHierarchyCall.java deleted file mode 100644 index 8980441e5..000000000 --- a/org.eclipse.lsp4j/src/main/xtend-gen/org/eclipse/lsp4j/CallHierarchyCall.java +++ /dev/null @@ -1,141 +0,0 @@ -/** - * Copyright (c) 2016-2018 TypeFox and others. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v. 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0, - * or the Eclipse Distribution License v. 1.0 which is available at - * http://www.eclipse.org/org/documents/edl-v10.php. - * - * SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause - */ -package org.eclipse.lsp4j; - -import com.google.common.annotations.Beta; -import org.eclipse.lsp4j.CallHierarchySymbol; -import org.eclipse.lsp4j.Range; -import org.eclipse.lsp4j.jsonrpc.validation.NonNull; -import org.eclipse.lsp4j.util.Preconditions; -import org.eclipse.xtext.xbase.lib.Pure; -import org.eclipse.xtext.xbase.lib.util.ToStringBuilder; - -/** - * Each {@code CallHierarchyCall} object defines a call from one {@code CallHierarchySymbol} to another. - */ -@Beta -@SuppressWarnings("all") -public class CallHierarchyCall { - /** - * The source range of the reference. The range is a sub range of the {@link CallHierarchyCall#getFrom from} symbol range. - */ - @NonNull - private Range range; - - /** - * The symbol that contains the reference. - */ - @NonNull - private CallHierarchySymbol from; - - /** - * The symbol that is referenced. - */ - @NonNull - private CallHierarchySymbol to; - - /** - * The source range of the reference. The range is a sub range of the {@link CallHierarchyCall#getFrom from} symbol range. - */ - @Pure - @NonNull - public Range getRange() { - return this.range; - } - - /** - * The source range of the reference. The range is a sub range of the {@link CallHierarchyCall#getFrom from} symbol range. - */ - public void setRange(@NonNull final Range range) { - this.range = Preconditions.checkNotNull(range, "range"); - } - - /** - * The symbol that contains the reference. - */ - @Pure - @NonNull - public CallHierarchySymbol getFrom() { - return this.from; - } - - /** - * The symbol that contains the reference. - */ - public void setFrom(@NonNull final CallHierarchySymbol from) { - this.from = Preconditions.checkNotNull(from, "from"); - } - - /** - * The symbol that is referenced. - */ - @Pure - @NonNull - public CallHierarchySymbol getTo() { - return this.to; - } - - /** - * The symbol that is referenced. - */ - public void setTo(@NonNull final CallHierarchySymbol to) { - this.to = Preconditions.checkNotNull(to, "to"); - } - - @Override - @Pure - public String toString() { - ToStringBuilder b = new ToStringBuilder(this); - b.add("range", this.range); - b.add("from", this.from); - b.add("to", this.to); - return b.toString(); - } - - @Override - @Pure - public boolean equals(final Object obj) { - if (this == obj) - return true; - if (obj == null) - return false; - if (getClass() != obj.getClass()) - return false; - CallHierarchyCall other = (CallHierarchyCall) obj; - if (this.range == null) { - if (other.range != null) - return false; - } else if (!this.range.equals(other.range)) - return false; - if (this.from == null) { - if (other.from != null) - return false; - } else if (!this.from.equals(other.from)) - return false; - if (this.to == null) { - if (other.to != null) - return false; - } else if (!this.to.equals(other.to)) - return false; - return true; - } - - @Override - @Pure - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + ((this.range== null) ? 0 : this.range.hashCode()); - result = prime * result + ((this.from== null) ? 0 : this.from.hashCode()); - return prime * result + ((this.to== null) ? 0 : this.to.hashCode()); - } -} diff --git a/org.eclipse.lsp4j/src/main/xtend-gen/org/eclipse/lsp4j/CallHierarchyIncomingCall.java b/org.eclipse.lsp4j/src/main/xtend-gen/org/eclipse/lsp4j/CallHierarchyIncomingCall.java new file mode 100644 index 000000000..6eec0120f --- /dev/null +++ b/org.eclipse.lsp4j/src/main/xtend-gen/org/eclipse/lsp4j/CallHierarchyIncomingCall.java @@ -0,0 +1,110 @@ +/** + * Copyright (c) 2016-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0, + * or the Eclipse Distribution License v. 1.0 which is available at + * http://www.eclipse.org/org/documents/edl-v10.php. + * + * SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause + */ +package org.eclipse.lsp4j; + +import com.google.common.annotations.Beta; +import java.util.Arrays; +import org.eclipse.lsp4j.CallHierarchyItem; +import org.eclipse.lsp4j.Range; +import org.eclipse.xtext.xbase.lib.Pure; +import org.eclipse.xtext.xbase.lib.util.ToStringBuilder; + +/** + * Represents an incoming call, e.g. a caller of a method or constructor. + */ +@Beta +@SuppressWarnings("all") +public class CallHierarchyIncomingCall { + /** + * The item that makes the call. + */ + private CallHierarchyItem from; + + /** + * The range at which at which the calls appears. This is relative to the caller + * denoted by [`this.from`](#CallHierarchyIncomingCall.from). + */ + private Range[] fromRanges; + + /** + * The item that makes the call. + */ + @Pure + public CallHierarchyItem getFrom() { + return this.from; + } + + /** + * The item that makes the call. + */ + public void setFrom(final CallHierarchyItem from) { + this.from = from; + } + + /** + * The range at which at which the calls appears. This is relative to the caller + * denoted by [`this.from`](#CallHierarchyIncomingCall.from). + */ + @Pure + public Range[] getFromRanges() { + return this.fromRanges; + } + + /** + * The range at which at which the calls appears. This is relative to the caller + * denoted by [`this.from`](#CallHierarchyIncomingCall.from). + */ + public void setFromRanges(final Range[] fromRanges) { + this.fromRanges = fromRanges; + } + + @Override + @Pure + public String toString() { + ToStringBuilder b = new ToStringBuilder(this); + b.add("from", this.from); + b.add("fromRanges", this.fromRanges); + return b.toString(); + } + + @Override + @Pure + public boolean equals(final Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + CallHierarchyIncomingCall other = (CallHierarchyIncomingCall) obj; + if (this.from == null) { + if (other.from != null) + return false; + } else if (!this.from.equals(other.from)) + return false; + if (this.fromRanges == null) { + if (other.fromRanges != null) + return false; + } else if (!Arrays.deepEquals(this.fromRanges, other.fromRanges)) + return false; + return true; + } + + @Override + @Pure + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((this.from== null) ? 0 : this.from.hashCode()); + return prime * result + ((this.fromRanges== null) ? 0 : Arrays.deepHashCode(this.fromRanges)); + } +} diff --git a/org.eclipse.lsp4j/src/main/xtend-gen/org/eclipse/lsp4j/CallHierarchyIncomingCallsParams.java b/org.eclipse.lsp4j/src/main/xtend-gen/org/eclipse/lsp4j/CallHierarchyIncomingCallsParams.java new file mode 100644 index 000000000..539a22f1c --- /dev/null +++ b/org.eclipse.lsp4j/src/main/xtend-gen/org/eclipse/lsp4j/CallHierarchyIncomingCallsParams.java @@ -0,0 +1,67 @@ +/** + * Copyright (c) 2016-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0, + * or the Eclipse Distribution License v. 1.0 which is available at + * http://www.eclipse.org/org/documents/edl-v10.php. + * + * SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause + */ +package org.eclipse.lsp4j; + +import com.google.common.annotations.Beta; +import org.eclipse.lsp4j.CallHierarchyItem; +import org.eclipse.xtext.xbase.lib.Pure; +import org.eclipse.xtext.xbase.lib.util.ToStringBuilder; + +/** + * The parameter of a `callHierarchy/incomingCalls` request. + */ +@Beta +@SuppressWarnings("all") +public class CallHierarchyIncomingCallsParams { + private CallHierarchyItem item; + + @Pure + public CallHierarchyItem getItem() { + return this.item; + } + + public void setItem(final CallHierarchyItem item) { + this.item = item; + } + + @Override + @Pure + public String toString() { + ToStringBuilder b = new ToStringBuilder(this); + b.add("item", this.item); + return b.toString(); + } + + @Override + @Pure + public boolean equals(final Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + CallHierarchyIncomingCallsParams other = (CallHierarchyIncomingCallsParams) obj; + if (this.item == null) { + if (other.item != null) + return false; + } else if (!this.item.equals(other.item)) + return false; + return true; + } + + @Override + @Pure + public int hashCode() { + return 31 * 1 + ((this.item== null) ? 0 : this.item.hashCode()); + } +} diff --git a/org.eclipse.lsp4j/src/main/xtend-gen/org/eclipse/lsp4j/CallHierarchySymbol.java b/org.eclipse.lsp4j/src/main/xtend-gen/org/eclipse/lsp4j/CallHierarchyItem.java similarity index 78% rename from org.eclipse.lsp4j/src/main/xtend-gen/org/eclipse/lsp4j/CallHierarchySymbol.java rename to org.eclipse.lsp4j/src/main/xtend-gen/org/eclipse/lsp4j/CallHierarchyItem.java index 70cf41c80..b5d564edc 100644 --- a/org.eclipse.lsp4j/src/main/xtend-gen/org/eclipse/lsp4j/CallHierarchySymbol.java +++ b/org.eclipse.lsp4j/src/main/xtend-gen/org/eclipse/lsp4j/CallHierarchyItem.java @@ -12,8 +12,10 @@ package org.eclipse.lsp4j; import com.google.common.annotations.Beta; +import java.util.Arrays; import org.eclipse.lsp4j.Range; import org.eclipse.lsp4j.SymbolKind; +import org.eclipse.lsp4j.SymbolTag; import org.eclipse.lsp4j.jsonrpc.validation.NonNull; import org.eclipse.lsp4j.util.Preconditions; import org.eclipse.xtext.xbase.lib.Pure; @@ -24,26 +26,31 @@ */ @Beta @SuppressWarnings("all") -public class CallHierarchySymbol { +public class CallHierarchyItem { /** - * The name of the symbol targeted by the call hierarchy request. + * The name of the item targeted by the call hierarchy request. */ @NonNull private String name; /** - * More detail for this symbol, e.g the signature of a function. + * More detail for this item, e.g the signature of a function. */ private String detail; /** - * The kind of this symbol. + * The kind of this item. */ @NonNull private SymbolKind kind; /** - * URI of the document containing the symbol. + * Tags for this item. + */ + private SymbolTag[] tags; + + /** + * The resource identifier of this item. */ @NonNull private String uri; @@ -58,13 +65,13 @@ public class CallHierarchySymbol { /** * The range that should be selected and revealed when this symbol is being picked, e.g the name of a function. - * Must be contained by the the {@link CallHierarchySymbol#getRange range}. + * Must be contained by the the {@link CallHierarchyItem#getRange range}. */ @NonNull private Range selectionRange; /** - * The name of the symbol targeted by the call hierarchy request. + * The name of the item targeted by the call hierarchy request. */ @Pure @NonNull @@ -73,14 +80,14 @@ public String getName() { } /** - * The name of the symbol targeted by the call hierarchy request. + * The name of the item targeted by the call hierarchy request. */ public void setName(@NonNull final String name) { this.name = Preconditions.checkNotNull(name, "name"); } /** - * More detail for this symbol, e.g the signature of a function. + * More detail for this item, e.g the signature of a function. */ @Pure public String getDetail() { @@ -88,14 +95,14 @@ public String getDetail() { } /** - * More detail for this symbol, e.g the signature of a function. + * More detail for this item, e.g the signature of a function. */ public void setDetail(final String detail) { this.detail = detail; } /** - * The kind of this symbol. + * The kind of this item. */ @Pure @NonNull @@ -104,14 +111,29 @@ public SymbolKind getKind() { } /** - * The kind of this symbol. + * The kind of this item. */ public void setKind(@NonNull final SymbolKind kind) { this.kind = Preconditions.checkNotNull(kind, "kind"); } /** - * URI of the document containing the symbol. + * Tags for this item. + */ + @Pure + public SymbolTag[] getTags() { + return this.tags; + } + + /** + * Tags for this item. + */ + public void setTags(final SymbolTag[] tags) { + this.tags = tags; + } + + /** + * The resource identifier of this item. */ @Pure @NonNull @@ -120,7 +142,7 @@ public String getUri() { } /** - * URI of the document containing the symbol. + * The resource identifier of this item. */ public void setUri(@NonNull final String uri) { this.uri = Preconditions.checkNotNull(uri, "uri"); @@ -148,7 +170,7 @@ public void setRange(@NonNull final Range range) { /** * The range that should be selected and revealed when this symbol is being picked, e.g the name of a function. - * Must be contained by the the {@link CallHierarchySymbol#getRange range}. + * Must be contained by the the {@link CallHierarchyItem#getRange range}. */ @Pure @NonNull @@ -158,7 +180,7 @@ public Range getSelectionRange() { /** * The range that should be selected and revealed when this symbol is being picked, e.g the name of a function. - * Must be contained by the the {@link CallHierarchySymbol#getRange range}. + * Must be contained by the the {@link CallHierarchyItem#getRange range}. */ public void setSelectionRange(@NonNull final Range selectionRange) { this.selectionRange = Preconditions.checkNotNull(selectionRange, "selectionRange"); @@ -171,6 +193,7 @@ public String toString() { b.add("name", this.name); b.add("detail", this.detail); b.add("kind", this.kind); + b.add("tags", this.tags); b.add("uri", this.uri); b.add("range", this.range); b.add("selectionRange", this.selectionRange); @@ -186,7 +209,7 @@ public boolean equals(final Object obj) { return false; if (getClass() != obj.getClass()) return false; - CallHierarchySymbol other = (CallHierarchySymbol) obj; + CallHierarchyItem other = (CallHierarchyItem) obj; if (this.name == null) { if (other.name != null) return false; @@ -202,6 +225,11 @@ public boolean equals(final Object obj) { return false; } else if (!this.kind.equals(other.kind)) return false; + if (this.tags == null) { + if (other.tags != null) + return false; + } else if (!Arrays.deepEquals(this.tags, other.tags)) + return false; if (this.uri == null) { if (other.uri != null) return false; @@ -228,6 +256,7 @@ public int hashCode() { result = prime * result + ((this.name== null) ? 0 : this.name.hashCode()); result = prime * result + ((this.detail== null) ? 0 : this.detail.hashCode()); result = prime * result + ((this.kind== null) ? 0 : this.kind.hashCode()); + result = prime * result + ((this.tags== null) ? 0 : Arrays.deepHashCode(this.tags)); result = prime * result + ((this.uri== null) ? 0 : this.uri.hashCode()); result = prime * result + ((this.range== null) ? 0 : this.range.hashCode()); return prime * result + ((this.selectionRange== null) ? 0 : this.selectionRange.hashCode()); diff --git a/org.eclipse.lsp4j/src/main/xtend-gen/org/eclipse/lsp4j/CallHierarchyOutgoingCall.java b/org.eclipse.lsp4j/src/main/xtend-gen/org/eclipse/lsp4j/CallHierarchyOutgoingCall.java new file mode 100644 index 000000000..5b6bbc9aa --- /dev/null +++ b/org.eclipse.lsp4j/src/main/xtend-gen/org/eclipse/lsp4j/CallHierarchyOutgoingCall.java @@ -0,0 +1,113 @@ +/** + * Copyright (c) 2016-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0, + * or the Eclipse Distribution License v. 1.0 which is available at + * http://www.eclipse.org/org/documents/edl-v10.php. + * + * SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause + */ +package org.eclipse.lsp4j; + +import com.google.common.annotations.Beta; +import java.util.Arrays; +import org.eclipse.lsp4j.CallHierarchyItem; +import org.eclipse.lsp4j.Range; +import org.eclipse.xtext.xbase.lib.Pure; +import org.eclipse.xtext.xbase.lib.util.ToStringBuilder; + +/** + * Represents an outgoing call, e.g. calling a getter from a method or a method from a constructor etc. + */ +@Beta +@SuppressWarnings("all") +public class CallHierarchyOutgoingCall { + /** + * The item that is called. + */ + private CallHierarchyItem to; + + /** + * The range at which this item is called. This is the range relative to the caller, e.g the item + * passed to [`provideCallHierarchyOutgoingCalls`](#CallHierarchyItemProvider.provideCallHierarchyOutgoingCalls) + * and not [`this.to`](#CallHierarchyOutgoingCall.to). + */ + private Range[] fromRanges; + + /** + * The item that is called. + */ + @Pure + public CallHierarchyItem getTo() { + return this.to; + } + + /** + * The item that is called. + */ + public void setTo(final CallHierarchyItem to) { + this.to = to; + } + + /** + * The range at which this item is called. This is the range relative to the caller, e.g the item + * passed to [`provideCallHierarchyOutgoingCalls`](#CallHierarchyItemProvider.provideCallHierarchyOutgoingCalls) + * and not [`this.to`](#CallHierarchyOutgoingCall.to). + */ + @Pure + public Range[] getFromRanges() { + return this.fromRanges; + } + + /** + * The range at which this item is called. This is the range relative to the caller, e.g the item + * passed to [`provideCallHierarchyOutgoingCalls`](#CallHierarchyItemProvider.provideCallHierarchyOutgoingCalls) + * and not [`this.to`](#CallHierarchyOutgoingCall.to). + */ + public void setFromRanges(final Range[] fromRanges) { + this.fromRanges = fromRanges; + } + + @Override + @Pure + public String toString() { + ToStringBuilder b = new ToStringBuilder(this); + b.add("to", this.to); + b.add("fromRanges", this.fromRanges); + return b.toString(); + } + + @Override + @Pure + public boolean equals(final Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + CallHierarchyOutgoingCall other = (CallHierarchyOutgoingCall) obj; + if (this.to == null) { + if (other.to != null) + return false; + } else if (!this.to.equals(other.to)) + return false; + if (this.fromRanges == null) { + if (other.fromRanges != null) + return false; + } else if (!Arrays.deepEquals(this.fromRanges, other.fromRanges)) + return false; + return true; + } + + @Override + @Pure + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((this.to== null) ? 0 : this.to.hashCode()); + return prime * result + ((this.fromRanges== null) ? 0 : Arrays.deepHashCode(this.fromRanges)); + } +} diff --git a/org.eclipse.lsp4j/src/main/xtend-gen/org/eclipse/lsp4j/CallHierarchyOutgoingCallsParams.java b/org.eclipse.lsp4j/src/main/xtend-gen/org/eclipse/lsp4j/CallHierarchyOutgoingCallsParams.java new file mode 100644 index 000000000..504faf6a7 --- /dev/null +++ b/org.eclipse.lsp4j/src/main/xtend-gen/org/eclipse/lsp4j/CallHierarchyOutgoingCallsParams.java @@ -0,0 +1,67 @@ +/** + * Copyright (c) 2016-2018 TypeFox and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0, + * or the Eclipse Distribution License v. 1.0 which is available at + * http://www.eclipse.org/org/documents/edl-v10.php. + * + * SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause + */ +package org.eclipse.lsp4j; + +import com.google.common.annotations.Beta; +import org.eclipse.lsp4j.CallHierarchyItem; +import org.eclipse.xtext.xbase.lib.Pure; +import org.eclipse.xtext.xbase.lib.util.ToStringBuilder; + +/** + * The parameter of a `callHierarchy/outgoingCalls` request. + */ +@Beta +@SuppressWarnings("all") +public class CallHierarchyOutgoingCallsParams { + private CallHierarchyItem item; + + @Pure + public CallHierarchyItem getItem() { + return this.item; + } + + public void setItem(final CallHierarchyItem item) { + this.item = item; + } + + @Override + @Pure + public String toString() { + ToStringBuilder b = new ToStringBuilder(this); + b.add("item", this.item); + return b.toString(); + } + + @Override + @Pure + public boolean equals(final Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + CallHierarchyOutgoingCallsParams other = (CallHierarchyOutgoingCallsParams) obj; + if (this.item == null) { + if (other.item != null) + return false; + } else if (!this.item.equals(other.item)) + return false; + return true; + } + + @Override + @Pure + public int hashCode() { + return 31 * 1 + ((this.item== null) ? 0 : this.item.hashCode()); + } +} diff --git a/org.eclipse.lsp4j/src/main/xtend-gen/org/eclipse/lsp4j/CallHierarchyParams.java b/org.eclipse.lsp4j/src/main/xtend-gen/org/eclipse/lsp4j/CallHierarchyPrepareParams.java similarity index 53% rename from org.eclipse.lsp4j/src/main/xtend-gen/org/eclipse/lsp4j/CallHierarchyParams.java rename to org.eclipse.lsp4j/src/main/xtend-gen/org/eclipse/lsp4j/CallHierarchyPrepareParams.java index 4ac482168..85501f660 100644 --- a/org.eclipse.lsp4j/src/main/xtend-gen/org/eclipse/lsp4j/CallHierarchyParams.java +++ b/org.eclipse.lsp4j/src/main/xtend-gen/org/eclipse/lsp4j/CallHierarchyPrepareParams.java @@ -12,46 +12,20 @@ package org.eclipse.lsp4j; import com.google.common.annotations.Beta; -import org.eclipse.lsp4j.CallHierarchyDirection; import org.eclipse.lsp4j.TextDocumentPositionParams; -import org.eclipse.lsp4j.jsonrpc.validation.NonNull; -import org.eclipse.lsp4j.util.Preconditions; import org.eclipse.xtext.xbase.lib.Pure; import org.eclipse.xtext.xbase.lib.util.ToStringBuilder; /** - * Returns a collection of calls from one symbol to another. + * The parameter of a `textDocument/prepareCallHierarchy` request. */ @Beta @SuppressWarnings("all") -public class CallHierarchyParams extends TextDocumentPositionParams { - /** - * The direction of calls to provide. - */ - @NonNull - private CallHierarchyDirection direction; - - /** - * The direction of calls to provide. - */ - @Pure - @NonNull - public CallHierarchyDirection getDirection() { - return this.direction; - } - - /** - * The direction of calls to provide. - */ - public void setDirection(@NonNull final CallHierarchyDirection direction) { - this.direction = Preconditions.checkNotNull(direction, "direction"); - } - +public class CallHierarchyPrepareParams extends TextDocumentPositionParams { @Override @Pure public String toString() { ToStringBuilder b = new ToStringBuilder(this); - b.add("direction", this.direction); b.add("textDocument", getTextDocument()); b.add("uri", getUri()); b.add("position", getPosition()); @@ -69,18 +43,12 @@ public boolean equals(final Object obj) { return false; if (!super.equals(obj)) return false; - CallHierarchyParams other = (CallHierarchyParams) obj; - if (this.direction == null) { - if (other.direction != null) - return false; - } else if (!this.direction.equals(other.direction)) - return false; return true; } @Override @Pure public int hashCode() { - return 31 * super.hashCode() + ((this.direction== null) ? 0 : this.direction.hashCode()); + return super.hashCode(); } } From 7ca876b5a20fbae35f5495c186497199f9dd8724 Mon Sep 17 00:00:00 2001 From: Jinbo Wang Date: Tue, 17 Dec 2019 10:53:54 +0800 Subject: [PATCH 2/2] Address review comments Signed-off-by: Jinbo Wang --- .../java/org/eclipse/lsp4j/Protocol.xtend | 42 +++++++++++++++++-- .../lsp4j/CallHierarchyIncomingCall.java | 32 ++++++++++---- .../CallHierarchyIncomingCallsParams.java | 15 ++++++- .../org/eclipse/lsp4j/CallHierarchyItem.java | 12 +++--- .../lsp4j/CallHierarchyOutgoingCall.java | 32 ++++++++++---- .../CallHierarchyOutgoingCallsParams.java | 15 ++++++- 6 files changed, 117 insertions(+), 31 deletions(-) diff --git a/org.eclipse.lsp4j/src/main/java/org/eclipse/lsp4j/Protocol.xtend b/org.eclipse.lsp4j/src/main/java/org/eclipse/lsp4j/Protocol.xtend index 2f7874c58..b8dd67b75 100644 --- a/org.eclipse.lsp4j/src/main/java/org/eclipse/lsp4j/Protocol.xtend +++ b/org.eclipse.lsp4j/src/main/java/org/eclipse/lsp4j/Protocol.xtend @@ -4864,7 +4864,15 @@ class CallHierarchyPrepareParams extends TextDocumentPositionParams { @Beta @JsonRpcData class CallHierarchyIncomingCallsParams { + @NonNull CallHierarchyItem item + + new() { + } + + new(@NonNull CallHierarchyItem item) { + this.item = item + } } /** @@ -4873,7 +4881,15 @@ class CallHierarchyIncomingCallsParams { @Beta @JsonRpcData class CallHierarchyOutgoingCallsParams { + @NonNull CallHierarchyItem item + + new() { + } + + new(@NonNull CallHierarchyItem item) { + this.item = item + } } /** @@ -4886,13 +4902,23 @@ class CallHierarchyIncomingCall { /** * The item that makes the call. */ + @NonNull CallHierarchyItem from /** * The range at which at which the calls appears. This is relative to the caller * denoted by [`this.from`](#CallHierarchyIncomingCall.from). */ - Range[] fromRanges + @NonNull + List fromRanges + + new() { + } + + new(@NonNull CallHierarchyItem from, @NonNull List fromRanges) { + this.from = from + this.fromRanges = fromRanges + } } /** @@ -4905,6 +4931,7 @@ class CallHierarchyOutgoingCall { /** * The item that is called. */ + @NonNull CallHierarchyItem to /** @@ -4912,7 +4939,16 @@ class CallHierarchyOutgoingCall { * passed to [`provideCallHierarchyOutgoingCalls`](#CallHierarchyItemProvider.provideCallHierarchyOutgoingCalls) * and not [`this.to`](#CallHierarchyOutgoingCall.to). */ - Range[] fromRanges + @NonNull + List fromRanges + + new() { + } + + new(@NonNull CallHierarchyItem to, @NonNull List fromRanges) { + this.to = to + this.fromRanges = fromRanges + } } /** @@ -4942,7 +4978,7 @@ class CallHierarchyItem { /** * Tags for this item. */ - SymbolTag[] tags + List tags /** * The resource identifier of this item. diff --git a/org.eclipse.lsp4j/src/main/xtend-gen/org/eclipse/lsp4j/CallHierarchyIncomingCall.java b/org.eclipse.lsp4j/src/main/xtend-gen/org/eclipse/lsp4j/CallHierarchyIncomingCall.java index 6eec0120f..2c27871c6 100644 --- a/org.eclipse.lsp4j/src/main/xtend-gen/org/eclipse/lsp4j/CallHierarchyIncomingCall.java +++ b/org.eclipse.lsp4j/src/main/xtend-gen/org/eclipse/lsp4j/CallHierarchyIncomingCall.java @@ -12,9 +12,11 @@ package org.eclipse.lsp4j; import com.google.common.annotations.Beta; -import java.util.Arrays; +import java.util.List; import org.eclipse.lsp4j.CallHierarchyItem; import org.eclipse.lsp4j.Range; +import org.eclipse.lsp4j.jsonrpc.validation.NonNull; +import org.eclipse.lsp4j.util.Preconditions; import org.eclipse.xtext.xbase.lib.Pure; import org.eclipse.xtext.xbase.lib.util.ToStringBuilder; @@ -27,18 +29,29 @@ public class CallHierarchyIncomingCall { /** * The item that makes the call. */ + @NonNull private CallHierarchyItem from; /** * The range at which at which the calls appears. This is relative to the caller * denoted by [`this.from`](#CallHierarchyIncomingCall.from). */ - private Range[] fromRanges; + @NonNull + private List fromRanges; + + public CallHierarchyIncomingCall() { + } + + public CallHierarchyIncomingCall(@NonNull final CallHierarchyItem from, @NonNull final List fromRanges) { + this.from = from; + this.fromRanges = fromRanges; + } /** * The item that makes the call. */ @Pure + @NonNull public CallHierarchyItem getFrom() { return this.from; } @@ -46,8 +59,8 @@ public CallHierarchyItem getFrom() { /** * The item that makes the call. */ - public void setFrom(final CallHierarchyItem from) { - this.from = from; + public void setFrom(@NonNull final CallHierarchyItem from) { + this.from = Preconditions.checkNotNull(from, "from"); } /** @@ -55,7 +68,8 @@ public void setFrom(final CallHierarchyItem from) { * denoted by [`this.from`](#CallHierarchyIncomingCall.from). */ @Pure - public Range[] getFromRanges() { + @NonNull + public List getFromRanges() { return this.fromRanges; } @@ -63,8 +77,8 @@ public Range[] getFromRanges() { * The range at which at which the calls appears. This is relative to the caller * denoted by [`this.from`](#CallHierarchyIncomingCall.from). */ - public void setFromRanges(final Range[] fromRanges) { - this.fromRanges = fromRanges; + public void setFromRanges(@NonNull final List fromRanges) { + this.fromRanges = Preconditions.checkNotNull(fromRanges, "fromRanges"); } @Override @@ -94,7 +108,7 @@ public boolean equals(final Object obj) { if (this.fromRanges == null) { if (other.fromRanges != null) return false; - } else if (!Arrays.deepEquals(this.fromRanges, other.fromRanges)) + } else if (!this.fromRanges.equals(other.fromRanges)) return false; return true; } @@ -105,6 +119,6 @@ public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((this.from== null) ? 0 : this.from.hashCode()); - return prime * result + ((this.fromRanges== null) ? 0 : Arrays.deepHashCode(this.fromRanges)); + return prime * result + ((this.fromRanges== null) ? 0 : this.fromRanges.hashCode()); } } diff --git a/org.eclipse.lsp4j/src/main/xtend-gen/org/eclipse/lsp4j/CallHierarchyIncomingCallsParams.java b/org.eclipse.lsp4j/src/main/xtend-gen/org/eclipse/lsp4j/CallHierarchyIncomingCallsParams.java index 539a22f1c..510d46278 100644 --- a/org.eclipse.lsp4j/src/main/xtend-gen/org/eclipse/lsp4j/CallHierarchyIncomingCallsParams.java +++ b/org.eclipse.lsp4j/src/main/xtend-gen/org/eclipse/lsp4j/CallHierarchyIncomingCallsParams.java @@ -13,6 +13,8 @@ import com.google.common.annotations.Beta; import org.eclipse.lsp4j.CallHierarchyItem; +import org.eclipse.lsp4j.jsonrpc.validation.NonNull; +import org.eclipse.lsp4j.util.Preconditions; import org.eclipse.xtext.xbase.lib.Pure; import org.eclipse.xtext.xbase.lib.util.ToStringBuilder; @@ -22,15 +24,24 @@ @Beta @SuppressWarnings("all") public class CallHierarchyIncomingCallsParams { + @NonNull private CallHierarchyItem item; + public CallHierarchyIncomingCallsParams() { + } + + public CallHierarchyIncomingCallsParams(@NonNull final CallHierarchyItem item) { + this.item = item; + } + @Pure + @NonNull public CallHierarchyItem getItem() { return this.item; } - public void setItem(final CallHierarchyItem item) { - this.item = item; + public void setItem(@NonNull final CallHierarchyItem item) { + this.item = Preconditions.checkNotNull(item, "item"); } @Override diff --git a/org.eclipse.lsp4j/src/main/xtend-gen/org/eclipse/lsp4j/CallHierarchyItem.java b/org.eclipse.lsp4j/src/main/xtend-gen/org/eclipse/lsp4j/CallHierarchyItem.java index b5d564edc..8136f8384 100644 --- a/org.eclipse.lsp4j/src/main/xtend-gen/org/eclipse/lsp4j/CallHierarchyItem.java +++ b/org.eclipse.lsp4j/src/main/xtend-gen/org/eclipse/lsp4j/CallHierarchyItem.java @@ -12,7 +12,7 @@ package org.eclipse.lsp4j; import com.google.common.annotations.Beta; -import java.util.Arrays; +import java.util.List; import org.eclipse.lsp4j.Range; import org.eclipse.lsp4j.SymbolKind; import org.eclipse.lsp4j.SymbolTag; @@ -47,7 +47,7 @@ public class CallHierarchyItem { /** * Tags for this item. */ - private SymbolTag[] tags; + private List tags; /** * The resource identifier of this item. @@ -121,14 +121,14 @@ public void setKind(@NonNull final SymbolKind kind) { * Tags for this item. */ @Pure - public SymbolTag[] getTags() { + public List getTags() { return this.tags; } /** * Tags for this item. */ - public void setTags(final SymbolTag[] tags) { + public void setTags(final List tags) { this.tags = tags; } @@ -228,7 +228,7 @@ public boolean equals(final Object obj) { if (this.tags == null) { if (other.tags != null) return false; - } else if (!Arrays.deepEquals(this.tags, other.tags)) + } else if (!this.tags.equals(other.tags)) return false; if (this.uri == null) { if (other.uri != null) @@ -256,7 +256,7 @@ public int hashCode() { result = prime * result + ((this.name== null) ? 0 : this.name.hashCode()); result = prime * result + ((this.detail== null) ? 0 : this.detail.hashCode()); result = prime * result + ((this.kind== null) ? 0 : this.kind.hashCode()); - result = prime * result + ((this.tags== null) ? 0 : Arrays.deepHashCode(this.tags)); + result = prime * result + ((this.tags== null) ? 0 : this.tags.hashCode()); result = prime * result + ((this.uri== null) ? 0 : this.uri.hashCode()); result = prime * result + ((this.range== null) ? 0 : this.range.hashCode()); return prime * result + ((this.selectionRange== null) ? 0 : this.selectionRange.hashCode()); diff --git a/org.eclipse.lsp4j/src/main/xtend-gen/org/eclipse/lsp4j/CallHierarchyOutgoingCall.java b/org.eclipse.lsp4j/src/main/xtend-gen/org/eclipse/lsp4j/CallHierarchyOutgoingCall.java index 5b6bbc9aa..2e0b03dd2 100644 --- a/org.eclipse.lsp4j/src/main/xtend-gen/org/eclipse/lsp4j/CallHierarchyOutgoingCall.java +++ b/org.eclipse.lsp4j/src/main/xtend-gen/org/eclipse/lsp4j/CallHierarchyOutgoingCall.java @@ -12,9 +12,11 @@ package org.eclipse.lsp4j; import com.google.common.annotations.Beta; -import java.util.Arrays; +import java.util.List; import org.eclipse.lsp4j.CallHierarchyItem; import org.eclipse.lsp4j.Range; +import org.eclipse.lsp4j.jsonrpc.validation.NonNull; +import org.eclipse.lsp4j.util.Preconditions; import org.eclipse.xtext.xbase.lib.Pure; import org.eclipse.xtext.xbase.lib.util.ToStringBuilder; @@ -27,6 +29,7 @@ public class CallHierarchyOutgoingCall { /** * The item that is called. */ + @NonNull private CallHierarchyItem to; /** @@ -34,12 +37,22 @@ public class CallHierarchyOutgoingCall { * passed to [`provideCallHierarchyOutgoingCalls`](#CallHierarchyItemProvider.provideCallHierarchyOutgoingCalls) * and not [`this.to`](#CallHierarchyOutgoingCall.to). */ - private Range[] fromRanges; + @NonNull + private List fromRanges; + + public CallHierarchyOutgoingCall() { + } + + public CallHierarchyOutgoingCall(@NonNull final CallHierarchyItem to, @NonNull final List fromRanges) { + this.to = to; + this.fromRanges = fromRanges; + } /** * The item that is called. */ @Pure + @NonNull public CallHierarchyItem getTo() { return this.to; } @@ -47,8 +60,8 @@ public CallHierarchyItem getTo() { /** * The item that is called. */ - public void setTo(final CallHierarchyItem to) { - this.to = to; + public void setTo(@NonNull final CallHierarchyItem to) { + this.to = Preconditions.checkNotNull(to, "to"); } /** @@ -57,7 +70,8 @@ public void setTo(final CallHierarchyItem to) { * and not [`this.to`](#CallHierarchyOutgoingCall.to). */ @Pure - public Range[] getFromRanges() { + @NonNull + public List getFromRanges() { return this.fromRanges; } @@ -66,8 +80,8 @@ public Range[] getFromRanges() { * passed to [`provideCallHierarchyOutgoingCalls`](#CallHierarchyItemProvider.provideCallHierarchyOutgoingCalls) * and not [`this.to`](#CallHierarchyOutgoingCall.to). */ - public void setFromRanges(final Range[] fromRanges) { - this.fromRanges = fromRanges; + public void setFromRanges(@NonNull final List fromRanges) { + this.fromRanges = Preconditions.checkNotNull(fromRanges, "fromRanges"); } @Override @@ -97,7 +111,7 @@ public boolean equals(final Object obj) { if (this.fromRanges == null) { if (other.fromRanges != null) return false; - } else if (!Arrays.deepEquals(this.fromRanges, other.fromRanges)) + } else if (!this.fromRanges.equals(other.fromRanges)) return false; return true; } @@ -108,6 +122,6 @@ public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((this.to== null) ? 0 : this.to.hashCode()); - return prime * result + ((this.fromRanges== null) ? 0 : Arrays.deepHashCode(this.fromRanges)); + return prime * result + ((this.fromRanges== null) ? 0 : this.fromRanges.hashCode()); } } diff --git a/org.eclipse.lsp4j/src/main/xtend-gen/org/eclipse/lsp4j/CallHierarchyOutgoingCallsParams.java b/org.eclipse.lsp4j/src/main/xtend-gen/org/eclipse/lsp4j/CallHierarchyOutgoingCallsParams.java index 504faf6a7..7b73999fd 100644 --- a/org.eclipse.lsp4j/src/main/xtend-gen/org/eclipse/lsp4j/CallHierarchyOutgoingCallsParams.java +++ b/org.eclipse.lsp4j/src/main/xtend-gen/org/eclipse/lsp4j/CallHierarchyOutgoingCallsParams.java @@ -13,6 +13,8 @@ import com.google.common.annotations.Beta; import org.eclipse.lsp4j.CallHierarchyItem; +import org.eclipse.lsp4j.jsonrpc.validation.NonNull; +import org.eclipse.lsp4j.util.Preconditions; import org.eclipse.xtext.xbase.lib.Pure; import org.eclipse.xtext.xbase.lib.util.ToStringBuilder; @@ -22,15 +24,24 @@ @Beta @SuppressWarnings("all") public class CallHierarchyOutgoingCallsParams { + @NonNull private CallHierarchyItem item; + public CallHierarchyOutgoingCallsParams() { + } + + public CallHierarchyOutgoingCallsParams(@NonNull final CallHierarchyItem item) { + this.item = item; + } + @Pure + @NonNull public CallHierarchyItem getItem() { return this.item; } - public void setItem(final CallHierarchyItem item) { - this.item = item; + public void setItem(@NonNull final CallHierarchyItem item) { + this.item = Preconditions.checkNotNull(item, "item"); } @Override