forked from eclipse-lsp4j/lsp4j
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
eclipse-lsp4jGH-317: Adjusted the
textDocument/callHierarchy
to the…
… spec. Closes eclipse-lsp4j#317. Signed-off-by: Akos Kitta <kittaakos@typefox.io>
- Loading branch information
Showing
8 changed files
with
182 additions
and
403 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
149 changes: 149 additions & 0 deletions
149
org.eclipse.lsp4j/src/main/xtend-gen/org/eclipse/lsp4j/CallHierarchyCall.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,149 @@ | ||
/** | ||
* 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.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) { | ||
if (range == null) { | ||
throw new IllegalArgumentException("Property must not be null: range"); | ||
} | ||
this.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) { | ||
if (from == null) { | ||
throw new IllegalArgumentException("Property must not be null: from"); | ||
} | ||
this.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) { | ||
if (to == null) { | ||
throw new IllegalArgumentException("Property must not be null: to"); | ||
} | ||
this.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()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.