Skip to content

Commit ce5193e

Browse files
committed
fix: make sure run-task callback from new graph still works
1 parent ec98511 commit ce5193e

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

apps/intellij/src/main/kotlin/dev/nx/console/graph/NxGraphBrowserBase.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,8 @@ abstract class NxGraphBrowserBase(protected val project: Project) : Disposable {
279279
return true
280280
}
281281
"run-task" -> {
282-
event.payload?.taskId?.also {
282+
val task = event.payload?.taskName ?: event.payload?.taskId
283+
task?.also {
283284
NxTaskExecutionManager.getInstance(project).execute(it)
284285
}
285286
return true
@@ -475,6 +476,7 @@ data class NxGraphInteractionPayload(
475476
val targetName: String? = null,
476477
val url: String? = null,
477478
val taskId: String? = null,
479+
val taskName: String? = null,
478480
val targetConfigString: String? = null,
479481
val helpCommand: String? = null,
480482
val helpCwd: String? = null,

libs/vscode/graph-base/src/handle-graph-interaction-event.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export async function handleGraphInteractionEventBase(event: {
1717

1818
commands.executeCommand(
1919
'vscode.open',
20-
Uri.file(join(workspacePath, event.payload.url))
20+
Uri.file(join(workspacePath, event.payload.url)),
2121
);
2222
return true;
2323
}
@@ -39,7 +39,7 @@ export async function handleGraphInteractionEventBase(event: {
3939
});
4040
CliTaskProvider.instance.executeTask({
4141
command: 'run',
42-
positional: event.payload.taskId,
42+
positional: event.payload.taskName ?? event.payload.taskId,
4343
flags: [],
4444
});
4545
return true;
@@ -57,7 +57,7 @@ export async function handleGraphInteractionEventBase(event: {
5757
if (!project) return;
5858
importNxPackagePath<typeof import('nx/src/devkit-exports')>(
5959
workspacePath,
60-
'src/devkit-exports'
60+
'src/devkit-exports',
6161
).then(({ detectPackageManager }) => {
6262
const pkgManager = detectPackageManager(workspacePath);
6363
tasks.executeTask(
@@ -77,8 +77,8 @@ export async function handleGraphInteractionEventBase(event: {
7777
env: {
7878
NX_CONSOLE: 'true',
7979
},
80-
})
81-
)
80+
}),
81+
),
8282
);
8383
});
8484
});

0 commit comments

Comments
 (0)