Skip to content

Commit 7e2fa9e

Browse files
committed
Refactor resource URI handling in project explorer to use bi-category scheme
1 parent 8bc754c commit 7e2fa9e

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

workspaces/bi/bi-extension/src/project-explorer/project-explorer-provider.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ function generateTreeData(
192192
'project',
193193
true
194194
);
195-
projectRootEntry.resourceUri = Uri.file(packagePath);
195+
projectRootEntry.resourceUri = Uri.parse(`bi-category:${packagePath}`);
196196
projectRootEntry.contextValue = 'bi-project';
197197
const children = getEntriesBI(components);
198198
projectRootEntry.children = children;
@@ -212,7 +212,7 @@ function getEntriesBI(project: ProjectStructure): ProjectExplorerEntry[] {
212212
'start',
213213
false
214214
);
215-
entryPoints.resourceUri = Uri.file(projectPath);
215+
entryPoints.resourceUri = Uri.parse(`bi-category:${projectPath}`);
216216
entryPoints.contextValue = "entryPoint";
217217
entryPoints.children = [];
218218
if (project.directoryMap[DIRECTORY_MAP.AUTOMATION].length > 0) {
@@ -232,7 +232,7 @@ function getEntriesBI(project: ProjectStructure): ProjectExplorerEntry[] {
232232
'radio',
233233
false
234234
);
235-
listeners.resourceUri = Uri.file(projectPath);
235+
listeners.resourceUri = Uri.parse(`bi-category:${projectPath}`);
236236
listeners.contextValue = "listeners";
237237
listeners.children = getComponents(project.directoryMap[DIRECTORY_MAP.LISTENER], DIRECTORY_MAP.LISTENER, projectPath);
238238
if (listeners.children.length > 0) {
@@ -248,7 +248,7 @@ function getEntriesBI(project: ProjectStructure): ProjectExplorerEntry[] {
248248
'connection',
249249
false
250250
);
251-
connections.resourceUri = Uri.file(projectPath);
251+
connections.resourceUri = Uri.parse(`bi-category:${projectPath}`);
252252
connections.contextValue = "connections";
253253
connections.children = getComponents(project.directoryMap[DIRECTORY_MAP.CONNECTION], DIRECTORY_MAP.CONNECTION, projectPath);
254254
if (connections.children.length > 0) {
@@ -264,7 +264,7 @@ function getEntriesBI(project: ProjectStructure): ProjectExplorerEntry[] {
264264
'type',
265265
false
266266
);
267-
types.resourceUri = Uri.file(projectPath);
267+
types.resourceUri = Uri.parse(`bi-category:${projectPath}`);
268268
types.contextValue = "types";
269269
types.children = getComponents([
270270
...project.directoryMap[DIRECTORY_MAP.TYPE]
@@ -282,7 +282,7 @@ function getEntriesBI(project: ProjectStructure): ProjectExplorerEntry[] {
282282
'function',
283283
false
284284
);
285-
functions.resourceUri = Uri.file(projectPath);
285+
functions.resourceUri = Uri.parse(`bi-category:${projectPath}`);
286286
functions.contextValue = "functions";
287287
functions.children = getComponents(project.directoryMap[DIRECTORY_MAP.FUNCTION], DIRECTORY_MAP.FUNCTION, projectPath);
288288
if (functions.children.length > 0) {
@@ -298,7 +298,7 @@ function getEntriesBI(project: ProjectStructure): ProjectExplorerEntry[] {
298298
'dataMapper',
299299
false
300300
);
301-
dataMappers.resourceUri = Uri.file(projectPath);
301+
dataMappers.resourceUri = Uri.parse(`bi-category:${projectPath}`);
302302
dataMappers.contextValue = "dataMappers";
303303
dataMappers.children = getComponents(project.directoryMap[DIRECTORY_MAP.DATA_MAPPER], DIRECTORY_MAP.DATA_MAPPER, projectPath);
304304
if (dataMappers.children.length > 0) {
@@ -314,7 +314,7 @@ function getEntriesBI(project: ProjectStructure): ProjectExplorerEntry[] {
314314
'config',
315315
false
316316
);
317-
configs.resourceUri = Uri.file(projectPath);
317+
configs.resourceUri = Uri.parse(`bi-category:${projectPath}`);
318318
configs.contextValue = "configurations";
319319
entries.push(configs);
320320

@@ -327,7 +327,7 @@ function getEntriesBI(project: ProjectStructure): ProjectExplorerEntry[] {
327327
'function',
328328
false
329329
);
330-
naturalFunctions.resourceUri = Uri.file(projectPath);
330+
naturalFunctions.resourceUri = Uri.parse(`bi-category:${projectPath}`);
331331
naturalFunctions.contextValue = "naturalFunctions";
332332
naturalFunctions.children = getComponents(project.directoryMap[DIRECTORY_MAP.NP_FUNCTION], DIRECTORY_MAP.NP_FUNCTION, projectPath);
333333
if (naturalFunctions.children.length > 0) {
@@ -344,7 +344,7 @@ function getEntriesBI(project: ProjectStructure): ProjectExplorerEntry[] {
344344
'connection',
345345
false
346346
);
347-
localConnectors.resourceUri = Uri.file(projectPath);
347+
localConnectors.resourceUri = Uri.parse(`bi-category:${projectPath}`);
348348
localConnectors.contextValue = "localConnectors";
349349
localConnectors.children = getComponents(project.directoryMap[DIRECTORY_MAP.LOCAL_CONNECTORS], DIRECTORY_MAP.CONNECTOR, projectPath);
350350
if (localConnectors.children.length > 0) {
@@ -372,7 +372,7 @@ function getComponents(items: ProjectStructureArtifactResponse[], itemType: DIRE
372372
comp.path,
373373
comp.icon
374374
);
375-
fileEntry.resourceUri = Uri.file(projectPath);
375+
fileEntry.resourceUri = Uri.parse(`bi-category:${projectPath}`);
376376
fileEntry.command = {
377377
"title": "Visualize",
378378
"command": SHARED_COMMANDS.SHOW_VISUALIZER,

0 commit comments

Comments
 (0)