Skip to content

Commit 3f786fd

Browse files
committed
fix: now project nodes are updated properly
1 parent 4c7d499 commit 3f786fd

2 files changed

Lines changed: 4 additions & 9 deletions

File tree

plugin/src/main/java/io/snyk/eclipse/plugin/views/snyktoolview/SnykToolView.java

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,8 @@ public void setFocus() {
132132
public void setNodeText(BaseTreeNode node, String text) {
133133
node.setText(text);
134134
Display.getDefault().asyncExec(() -> {
135-
this.treeViewer.update(node, null);
135+
this.treeViewer.refresh(node, true);
136+
this.treeViewer.refresh(node.getParent(), true);
136137
});
137138
}
138139

@@ -267,14 +268,12 @@ public void toggleIgnoresButtons() {
267268
menuManager.update(true);
268269

269270
});
270-
271271
}
272272

273273
/*
274274
* Sets up for doing a Net New Issues scan.
275275
*/
276276
public void enableDelta() {
277-
278277
if (this.treeViewer != null && !this.treeViewer.getTree().isDisposed()) {
279278
BaseTreeNode[] children = (BaseTreeNode[]) getRoot().getChildren();
280279

@@ -285,9 +284,8 @@ public void enableDelta() {
285284
String projectName = ResourceUtils.getProjectByPath(contentNode.getPath()).getName();
286285
String baseBranch = folderConfigs.getBaseBranch(projectPath);
287286

288-
setNodeText(contentNode, String.format("%s - Click here choose base branch [ current: %s ]",
287+
contentNode.setName(String.format("%s - Click here choose base branch [ current: %s ]",
289288
projectName, baseBranch));
290-
291289
}
292290
}
293291
}
@@ -303,10 +301,8 @@ public void disableDelta() {
303301
for (BaseTreeNode node : children) {
304302
if (node instanceof ContentRootNode) {
305303
ContentRootNode contentNode = (ContentRootNode) node;
306-
307304
String projectName = ResourceUtils.getProjectByPath(contentNode.getPath()).getName();
308-
309-
setNodeText(contentNode, projectName);
305+
contentNode.setName(projectName);
310306
}
311307
}
312308
}

plugin/src/main/java/io/snyk/languageserver/protocolextension/SnykExtendedLanguageClient.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,6 @@ public void triggerScan(String projectPath) {
195195
return;
196196
}
197197

198-
this.toolView.resetNode(this.toolView.getRoot());
199198
executeCommand(LsCommandID.COMMAND_WORKSPACE_SCAN, new ArrayList<>());
200199
} catch (Exception e) {
201200
SnykLogger.logError(e);

0 commit comments

Comments
 (0)