Legacy debt. Zowe Explorer originates from three separate plugins and although a lot of effort has gone in to making all three behave the same there are some areas of inconsistency which need to be ironed out.
To do this I propose creating AbstractZoweNode and AbstractZoweProvider representing nodes and trees respectively and allowing the three sets of classes to converge areas of common function and behavor and rationalize testing.
@Colin-Stone Can you share with me the architectural approach on how you are going to do this? I want to keep this in mind as I think about issue #354
@Colin-Stone Can you share with me the architectural approach on how you are going to do this? I want to keep this in mind as I think about issue #354
I have rewritten this based upon what I have learned
ok. I see. cool! thank you.
Is this the same as this one? #75
This is how I have done this.
interface IZoweTree<T> extends vscode.TreeDataProvider<T>interface IZoweTreeNodeinterface IZoweDatasetTreeNode extends IZoweTreeNodeinterface IZoweUSSTreeNode extends IZoweTreeNodeinterface IZoweJobTreeNode extends IZoweTreeNodeNodes can now be referenced via interfaces only. Not yet 100% the case with Trees, within extension they may still need to be referenced by concrete class
Next steps:
Review the current interfaces IZoweTreeNode.ts and IZoweTree.ts files considering
Still to do
Created the following type
export type IZoweNodeType = IZoweDatasetTreeNode | IZoweUSSTreeNode | IZoweJobTreeNode;
meaning we can now specify the following generic interfaces as operations on IZoweTree
rename(node: IZoweNodeType);
open(node: IZoweNodeType, preview: boolean);
copy(node: IZoweNodeType);
paste(node: IZoweNodeType);
delete(node: IZoweNodeType);
setItem(treeView: vscode.TreeView, node: IZoweNodeType);
saveSearch(node: IZoweNodeType);
saveFile(document: vscode.TextDocument);
refreshPS(node: IZoweNodeType);
addHistory(element: string);
getHistory();
deleteSession(node: IZoweNodeType): any;
getTreeView(): vscode.TreeView;
filterPrompt(node: IZoweNodeType): any;
so for example: filterPrompt replaces datasetFilterPrompt, ussFilterPrompt and searchPrompt.
This would then require a large operation of moving function out of extension.ts to the tree along with all the associated unit tests.
This part of the Epic has been done.