Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions src/OneExplorer/OneExplorer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import * as vscode from "vscode";
import { obtainWorkspaceRoots } from "../Utils/Helpers";
import { Logger } from "../Utils/Logger";

import { BackendContext } from "../Backend/API";
import { ConfigObj } from "./ConfigObject";
import { ArtifactAttr } from "./ArtifactLocator";
import { OneStorage } from "./OneStorage";
Expand Down Expand Up @@ -214,15 +215,10 @@ class NodeFactory {
"Config nodes cannot have attributes"
);
const ext = path.extname(fpath);
switch (ext) {
case ".edgetpucfg": {
node = new ConfigNode(uri, parent, "one.editor.edgetpucfg");
break;
}
case ".cfg":
default: {
node = new ConfigNode(uri, parent);
}
if (BackendContext.isRegistered("EdgeTPU") && ext === ".edgetpucfg") {
node = new ConfigNode(uri, parent, "one.editor.edgetpucfg");
} else {
node = new ConfigNode(uri, parent);
}
break;
}
Expand Down
5 changes: 4 additions & 1 deletion src/OneExplorer/OneStorage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import { Logger } from "../Utils/Logger";

import { ConfigObj } from "./ConfigObject";
import { Node, NodeType } from "./OneExplorer";
import { BackendContext } from "../Backend/API";

export { CfgToCfgObjMap as _unit_test_CfgToCfgObjMap };

Expand Down Expand Up @@ -208,7 +209,9 @@ export class OneStorage {
};

try {
const extList = [".cfg", ".edgetpucfg"];
const extList = BackendContext.isRegistered("EdgeTPU")
? [".cfg", ".edgetpucfg"]
: [".cfg"];

return roots
.map((root) =>
Expand Down