Skip to content

Commit

Permalink
#312 refresh tree when user change k8s context
Browse files Browse the repository at this point in the history
Signed-off-by: Yevhen Vydolob <[email protected]>
  • Loading branch information
evidolob committed Mar 2, 2021
1 parent 67c64e4 commit c3829e5
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1021,6 +1021,6 @@
"targz": "^1.0.1",
"unzip-stream": "^0.3.0",
"validator": "^11.0.0",
"vscode-kubernetes-tools-api": "1.1.0"
"vscode-kubernetes-tools-api": "1.3.0"
}
}
8 changes: 8 additions & 0 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,14 @@ export async function activate(context: vscode.ExtensionContext): Promise<void>
).at(undefined);
k8sExplorer.registerNodeContributor(nodeContributor);
}

const configurationApi = await k8s.extension.configuration.v1_1;
if (configurationApi.available) {
const confApi = configurationApi.api;
confApi.onDidChangeContext(() => {
pipelineExplorer.refresh();
});
}
vscode.workspace.onDidSaveTextDocument(async (document: vscode.TextDocument) => {
await updateTektonResource(document);
});
Expand Down

0 comments on commit c3829e5

Please sign in to comment.