forked from build-server-protocol/build-server-protocol
-
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.
**Problem** We want to pass along code actions via Diagnostics, even though this idea seems to have been shot down already in LSP microsoft/language-server-protocol 581. **Solution** This defines additional `actions` field to `Diagnostics`, mirroring sbt/sbt#7242.
- Loading branch information
Showing
11 changed files
with
394 additions
and
3 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
96 changes: 96 additions & 0 deletions
96
bsp4j/src/main/xtend-gen/ch/epfl/scala/bsp4j/CodeAction.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,96 @@ | ||
package ch.epfl.scala.bsp4j; | ||
|
||
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; | ||
|
||
@SuppressWarnings("all") | ||
public class CodeAction { | ||
@NonNull | ||
private String title; | ||
|
||
private String description; | ||
|
||
private WorkspaceEdit edit; | ||
|
||
public CodeAction(@NonNull final String title) { | ||
this.title = title; | ||
} | ||
|
||
@Pure | ||
@NonNull | ||
public String getTitle() { | ||
return this.title; | ||
} | ||
|
||
public void setTitle(@NonNull final String title) { | ||
this.title = Preconditions.checkNotNull(title, "title"); | ||
} | ||
|
||
@Pure | ||
public String getDescription() { | ||
return this.description; | ||
} | ||
|
||
public void setDescription(final String description) { | ||
this.description = description; | ||
} | ||
|
||
@Pure | ||
public WorkspaceEdit getEdit() { | ||
return this.edit; | ||
} | ||
|
||
public void setEdit(final WorkspaceEdit edit) { | ||
this.edit = edit; | ||
} | ||
|
||
@Override | ||
@Pure | ||
public String toString() { | ||
ToStringBuilder b = new ToStringBuilder(this); | ||
b.add("title", this.title); | ||
b.add("description", this.description); | ||
b.add("edit", this.edit); | ||
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; | ||
CodeAction other = (CodeAction) obj; | ||
if (this.title == null) { | ||
if (other.title != null) | ||
return false; | ||
} else if (!this.title.equals(other.title)) | ||
return false; | ||
if (this.description == null) { | ||
if (other.description != null) | ||
return false; | ||
} else if (!this.description.equals(other.description)) | ||
return false; | ||
if (this.edit == null) { | ||
if (other.edit != null) | ||
return false; | ||
} else if (!this.edit.equals(other.edit)) | ||
return false; | ||
return true; | ||
} | ||
|
||
@Override | ||
@Pure | ||
public int hashCode() { | ||
final int prime = 31; | ||
int result = 1; | ||
result = prime * result + ((this.title== null) ? 0 : this.title.hashCode()); | ||
result = prime * result + ((this.description== null) ? 0 : this.description.hashCode()); | ||
return prime * result + ((this.edit== null) ? 0 : this.edit.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
81 changes: 81 additions & 0 deletions
81
bsp4j/src/main/xtend-gen/ch/epfl/scala/bsp4j/TextEdit.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,81 @@ | ||
package ch.epfl.scala.bsp4j; | ||
|
||
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; | ||
|
||
@SuppressWarnings("all") | ||
public class TextEdit { | ||
@NonNull | ||
private Range range; | ||
|
||
@NonNull | ||
private String newText; | ||
|
||
public TextEdit(@NonNull final Range range, @NonNull final String newText) { | ||
this.range = range; | ||
this.newText = newText; | ||
} | ||
|
||
@Pure | ||
@NonNull | ||
public Range getRange() { | ||
return this.range; | ||
} | ||
|
||
public void setRange(@NonNull final Range range) { | ||
this.range = Preconditions.checkNotNull(range, "range"); | ||
} | ||
|
||
@Pure | ||
@NonNull | ||
public String getNewText() { | ||
return this.newText; | ||
} | ||
|
||
public void setNewText(@NonNull final String newText) { | ||
this.newText = Preconditions.checkNotNull(newText, "newText"); | ||
} | ||
|
||
@Override | ||
@Pure | ||
public String toString() { | ||
ToStringBuilder b = new ToStringBuilder(this); | ||
b.add("range", this.range); | ||
b.add("newText", this.newText); | ||
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; | ||
TextEdit other = (TextEdit) obj; | ||
if (this.range == null) { | ||
if (other.range != null) | ||
return false; | ||
} else if (!this.range.equals(other.range)) | ||
return false; | ||
if (this.newText == null) { | ||
if (other.newText != null) | ||
return false; | ||
} else if (!this.newText.equals(other.newText)) | ||
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()); | ||
return prime * result + ((this.newText== null) ? 0 : this.newText.hashCode()); | ||
} | ||
} |
55 changes: 55 additions & 0 deletions
55
bsp4j/src/main/xtend-gen/ch/epfl/scala/bsp4j/WorkspaceEdit.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,55 @@ | ||
package ch.epfl.scala.bsp4j; | ||
|
||
import java.util.List; | ||
import org.eclipse.xtext.xbase.lib.Pure; | ||
import org.eclipse.xtext.xbase.lib.util.ToStringBuilder; | ||
|
||
@SuppressWarnings("all") | ||
public class WorkspaceEdit { | ||
private List<TextEdit> changes; | ||
|
||
public WorkspaceEdit(final List<TextEdit> changes) { | ||
this.changes = changes; | ||
} | ||
|
||
@Pure | ||
public List<TextEdit> getChanges() { | ||
return this.changes; | ||
} | ||
|
||
public void setChanges(final List<TextEdit> changes) { | ||
this.changes = changes; | ||
} | ||
|
||
@Override | ||
@Pure | ||
public String toString() { | ||
ToStringBuilder b = new ToStringBuilder(this); | ||
b.add("changes", this.changes); | ||
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; | ||
WorkspaceEdit other = (WorkspaceEdit) obj; | ||
if (this.changes == null) { | ||
if (other.changes != null) | ||
return false; | ||
} else if (!this.changes.equals(other.changes)) | ||
return false; | ||
return true; | ||
} | ||
|
||
@Override | ||
@Pure | ||
public int hashCode() { | ||
return 31 * 1 + ((this.changes== null) ? 0 : this.changes.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.