Skip to content

Commit

Permalink
Send project name to the client along with labels.
Browse files Browse the repository at this point in the history
This is useful when presenting the different projects in a menu,
such as in redhat-developer/vscode-quarkus#215.

Signed-off-by: David Thompson <davthomp@redhat.com>
  • Loading branch information
datho7561 committed Jun 29, 2020
1 parent 31afca7 commit 60a26b1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,16 @@
*
*/
public class ProjectLabelInfoEntry {
public static final ProjectLabelInfoEntry EMPTY_PROJECT_INFO = new ProjectLabelInfoEntry("",
public static final ProjectLabelInfoEntry EMPTY_PROJECT_INFO = new ProjectLabelInfoEntry("", "",
Collections.emptyList());

private final String uri;
private final String name;
private final List<String> labels;

public ProjectLabelInfoEntry(String uri, List<String> labels) {
public ProjectLabelInfoEntry(String uri, String name, List<String> labels) {
this.uri = uri;
this.name = name;
this.labels = labels;
}

Expand All @@ -41,6 +43,15 @@ public String getUri() {
return uri;
}

/**
* Returns the name of the project
*
* @return The name of this project
*/
public String getName() {
return name;
}

/**
* Returns the labels for the current project uri
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public List<ProjectLabelInfoEntry> getProjectLabelInfo() {
private ProjectLabelInfoEntry getProjectLabelInfo(IProject project, List<String> types) {
String uri = JDTMicroProfileUtils.getProjectURI(project);
if (uri != null) {
return new ProjectLabelInfoEntry(uri, getProjectLabels(project, types));
return new ProjectLabelInfoEntry(uri, project.getName(), getProjectLabels(project, types));
}
return null;
}
Expand Down

0 comments on commit 60a26b1

Please sign in to comment.