Skip to content

Commit d0cfc19

Browse files
committed
docs(openspec): plan a run marker menu without PyCharm's profilers
The run marker of a Robot Framework test is to offer only Run, Debug, the runs with a profile and Modify Run Configuration, without PyCharm's Profile and Concurrency Diagram, and Concurrency Diagram is to end with a message wherever else PyCharm offers it, as Profile does.
1 parent 1fb272b commit d0cfc19

5 files changed

Lines changed: 153 additions & 0 deletions

File tree

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
schema: spec-driven
2+
created: 2026-10-24
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Design
2+
3+
## Context
4+
5+
See proposal.md for the motivation. Checked on 2026-10-24 in the IntelliJ 261 sources and in the UI-test PyCharm 2026.1 with the demo project:
6+
7+
- **The run marker's menu:** `RobotCodeRunLineMarkerContributor` builds it from `RunLineMarkerContributor.withExecutorActions(icon)`, that is `ExecutorAction.getActions(1)`: one `ExecutorAction` per registered executor, then the platform's extra actions such as "Modify Run Configuration…". `withProfileActions` puts "Run with Profile..." and "Debug with Profile..." after the executor actions.
8+
- **`ExecutorAction`** is a public class and exposes its executor as the public property `executor`; only `wrap` is `@ApiStatus.Internal`.
9+
- **The executors on the test "Order Coffee":** `Run` and `Debug`, `Coverage`, and `Profiler`, PyCharm's `DefaultProfilerExecutorGroup`. In the popup, the group's one executor action expands to two entries:
10+
- "Profile", executor `Profiler` (`com.intellij.python.profiler.ProfilerExecutor`), taken by `RobotCodeProfileRunner`;
11+
- "Concurrency Diagram", executor `ConcurrencyExecutor` (`com.intellij.python.concurrencyVisualizer.PyConcurrencyExecutor`), taken by PyCharm's `PyConcurrencyDebugRunner`.
12+
The coverage action stays hidden, since `RobotCodeRunConfiguration.canRunWithCoverage()` is false.
13+
- **Concurrency Diagram today:** it starts the test under PyCharm's Python debugger in the Debug tool window ("Connected to pydev debugger", Mode pydevd). The test passes, and no diagram appears.
14+
- **The editor's context menu** has both entries under "More Run/Debug"; the platform shows such an entry while a runner takes the configuration.
15+
- **`RobotCodeProfileRunner`** (`RobotCodeProgramRunner.kt`, registered `order="first"`) takes the executor `Profiler` for Robot Framework run configurations and rejects the run with `run.profile.notSupported`, "Robot Framework runs cannot be profiled.". Without it, PyCharm's profiler would take them as Python run configurations, since they extend `AbstractPythonRunConfiguration`.
16+
- **Tests:** `RobotCodeWithProfileActionsTest` checks the order of the gutter actions on `ExecutorAction.getActions(1)`; `RobotCodeDiscoveryProblemMarkersTest` calls `RobotCodeRunLineMarkerContributor().getInfo` with test items set through `setTestItemsForTests`.
17+
- **The PyCharm guide** (`guides/pycharm/running-tests.mdx`) says the menu offers "in PyCharm Professional also PyCharm's **Profile**, which Robot Framework runs do not support", and its picture `running-gutter-menu` with its alt text shows Profile and Concurrency Diagram.
18+
19+
## Goals / Non-Goals
20+
21+
**Goals:**
22+
23+
- The run marker offers only what Robot Framework runs support.
24+
- Concurrency Diagram for a Robot Framework run configuration ends like Profile, wherever PyCharm offers it.
25+
26+
**Non-Goals:**
27+
28+
- Removing Profile and Concurrency Diagram from the editor's context menu or the run widget: the platform shows them while a runner takes the configuration, and for Profile that runner has to be RobotCode's, or PyCharm's profiler would run.
29+
- Profiling or concurrency diagrams for Robot Framework runs.
30+
- Changes to "Run with Profile..." and "Debug with Profile...".
31+
32+
## Decisions
33+
34+
### The run marker keeps the executor actions of Run and Debug
35+
36+
The contributor drops every `ExecutorAction` whose executor is neither `DefaultRunExecutor.EXECUTOR_ID` nor `DefaultDebugExecutor.EXECUTOR_ID`, before `withProfileActions` places the profile actions after the remaining ones. This removes the profiler group with both its entries, and the coverage action that is hidden anyway.
37+
38+
Alternatives: dropping only the executor `Profiler`. Rejected: an executor that another plugin adds for Python run configurations would show up again, and RobotCode's runners take only Run and Debug. Refusing the profiler in `canRun` to hide the group. Rejected: PyCharm's profiler would then take the configuration.
39+
40+
### RobotCodeProfileRunner also takes Concurrency Diagram
41+
42+
`canRun` takes the executors `Profiler` and `ConcurrencyExecutor` for Robot Framework run configurations, and `execute` rejects the run with the message of the executor it got. The class and its runner id stay, so its registration stays as it is.
43+
44+
- **Message:** a new key `run.concurrencyDiagram.notSupported`, "Robot Framework runs have no concurrency diagram.".
45+
- *Alternative:* the message of Profile for both. Rejected: whoever chose Concurrency Diagram would read about profiling.
46+
- *Alternative:* a second runner class. Rejected: the same three lines twice.
47+
48+
### Documentation
49+
50+
The sentence in `running-tests.mdx` names the menu's entries without Profile, and the picture `running-gutter-menu` is taken again in light and dark with the part of `guide-running.sh` that takes it; its alt text names the entries the menu shows.
51+
52+
## Risks / Trade-offs
53+
54+
- [The executor ids `Profiler` and `ConcurrencyExecutor` are PyCharm's and could change] → the run marker filters by the ids of Run and Debug, which are the platform's; only the block of the two runs depends on PyCharm's ids, as the block of Profile already does.
55+
- [Profile and Concurrency Diagram stay under "More Run/Debug" and in the run widget] → they end with a message there; see the non-goals.
56+
- [A plugin's executor that could run Robot Framework configurations disappears from the run marker] → RobotCode's runners take only Run and Debug, so such an executor would run the configuration as a Python script.
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Proposal
2+
3+
## Why
4+
5+
In PyCharm Professional, the menu of a run marker offers PyCharm's **Profile** and **Concurrency Diagram** for Robot Framework tests (finding J5 of the review of the PyCharm guide). Neither works for Robot Framework runs:
6+
7+
- **Profile** ends with "Robot Framework runs cannot be profiled." It is easy to mix up with **Run with Profile...**, which runs with a profile of `robot.toml`.
8+
- **Concurrency Diagram** starts the test under PyCharm's Python debugger, and no diagram appears (checked in the harness on 2026-10-24).
9+
10+
The user decided on 2026-10-24 that both leave the run marker, and that Concurrency Diagram ends with a message like Profile wherever else PyCharm offers it.
11+
12+
## What Changes
13+
14+
- The menu of a run marker offers **Run**, **Debug**, **Run with Profile...**, **Debug with Profile...** and **Modify Run Configuration…**, without **Profile** and **Concurrency Diagram**.
15+
- Elsewhere, for example under **More Run/Debug** in the editor's context menu or in the run widget, **Concurrency Diagram** for a Robot Framework run configuration ends with a message, without starting a process, as **Profile** does today.
16+
- The PyCharm guide no longer mentions Profile in the run marker's menu, and its picture of the menu is taken again.
17+
18+
## Capabilities
19+
20+
### New Capabilities
21+
22+
None.
23+
24+
### Modified Capabilities
25+
26+
- `intellij-run-configurations`: the menu of a run marker without PyCharm's profilers, and Concurrency Diagram ending with a message like Profile.
27+
28+
## Impact
29+
30+
- `intellij-client`:
31+
- `RobotCodeRunLineMarkerContributor.kt` keeps only the executor actions of Run and Debug.
32+
- `RobotCodeProgramRunner.kt`: `RobotCodeProfileRunner` also takes the executor of Concurrency Diagram.
33+
- `RobotCode.properties` gets the message for Concurrency Diagram.
34+
- Platform tests for both.
35+
- `docs/src/content/docs/guides/pycharm/running-tests.mdx`: the sentence on the run marker's menu, and the picture `running-gutter-menu` in light and dark with its alt text.
36+
- No change to the language server, VS Code, the profile actions or other run configurations.
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
## ADDED Requirements
2+
3+
### Requirement: The menu of a run marker offers what Robot Framework runs support
4+
5+
The menu of the run marker of a Robot Framework test, task or suite SHALL offer Run, Debug, Run with Profile..., Debug with Profile... and Modify Run Configuration…. It SHALL NOT offer PyCharm's Profile or Concurrency Diagram, or another executor besides Run and Debug.
6+
7+
#### Scenario: Menu in PyCharm Professional
8+
9+
- **WHEN** the user clicks the run marker of the test "Order Coffee" in PyCharm Professional
10+
- **THEN** the menu shows Run, Debug, Run with Profile..., Debug with Profile... and Modify Run Configuration…, and neither Profile nor Concurrency Diagram
11+
12+
#### Scenario: Menu of a suite
13+
14+
- **WHEN** the user clicks the run marker on line 1 of a suite file in PyCharm Professional
15+
- **THEN** the menu shows the same entries as the run marker of a test
16+
17+
## MODIFIED Requirements
18+
19+
### Requirement: Run and Debug stay with RobotCode
20+
21+
Run SHALL show a Robot Framework run configuration in a Run tool window tab with the test tree and the console, and Debug SHALL start a session of the RobotCode debugger, whichever Python plugins are installed. "Run with Coverage" SHALL NOT be offered for Robot Framework run configurations. "Profile" SHALL end with a message that Robot Framework runs cannot be profiled, and "Concurrency Diagram" with a message that they have no concurrency diagram, both without starting a process.
22+
23+
#### Scenario: Run
24+
25+
- **WHEN** the user runs a Robot Framework run configuration with Run
26+
- **THEN** the Run tool window shows the test tree with the results and the console output
27+
28+
#### Scenario: Debug
29+
30+
- **WHEN** the user starts a Robot Framework run configuration with Debug while a Robot Framework breakpoint is set in a test it runs
31+
- **THEN** the RobotCode debugger stops at the breakpoint, and PyCharm's Python debugger does not start
32+
33+
#### Scenario: Profile in PyCharm Professional
34+
35+
- **WHEN** the user chooses "Profile" for a Robot Framework run configuration in PyCharm Professional
36+
- **THEN** no process starts, the IDE shows the message that Robot Framework runs cannot be profiled, and no "IDE error occurred" notification appears
37+
38+
#### Scenario: Concurrency Diagram in PyCharm Professional
39+
40+
- **WHEN** the user chooses "Concurrency Diagram" for a Robot Framework run configuration in PyCharm Professional, for example under "More Run/Debug" in the editor's context menu
41+
- **THEN** no process starts, the IDE shows the message that Robot Framework runs have no concurrency diagram, and no "IDE error occurred" notification appears
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Tasks
2+
3+
## 1. Plugin
4+
5+
- [ ] 1.1 In `RobotCodeRunLineMarkerContributor`, drop every `ExecutorAction` whose executor is neither Run nor Debug from the gutter actions before `withProfileActions` places the profile actions. Add a platform test, with test items set through `setTestItemsForTests` as in `RobotCodeDiscoveryProblemMarkersTest`, that the run marker of a test and of a suite offers no executor action besides Run and Debug while the profile actions and the platform's extra actions stay; register a further executor for the test so that the check does not depend on the executors of the test IDE. Verify that the new test fails without the change, and run the full `./gradlew test` and `./gradlew verifyPlugin` (no new usages apart from LSP4IJ's experimental API).
6+
- [ ] 1.2 Let `RobotCodeProfileRunner` take the executor `ConcurrencyExecutor` besides `Profiler` for Robot Framework run configurations, and reject a run with the message of its executor; add `run.concurrencyDiagram.notSupported` = "Robot Framework runs have no concurrency diagram." to `RobotCode.properties`. Add a platform test that the runner takes both executors for a Robot Framework run configuration and no other executor, and that `execute` rejects each with its message. Verify with the full `./gradlew test`.
7+
8+
## 2. Documentation
9+
10+
- [ ] 2.1 In `docs/src/content/docs/guides/pycharm/running-tests.mdx`, name the run marker's entries without PyCharm's Profile. Take the picture `running-gutter-menu` again in light and dark with its part of `playground/robotcode-demo/pycharm/guide-running.sh`, and let its alt text name the entries the menu shows. Mark finding J5 in `playground/pycharm-befunde.md` as resolved by this change. Verify that `npm run docs:build` passes.
11+
12+
## 3. Verification
13+
14+
- [ ] 3.1 In the UI-test PyCharm, before (plugin from HEAD) and after the change, on the test "Order Coffee" and on line 1 of its suite file: the run marker's menu, "Profile" and "Concurrency Diagram" under "More Run/Debug" in the editor's context menu, and `idea.log`. After the change, the menu shows Run, Debug, Run with Profile..., Debug with Profile... and Modify Run Configuration…; both entries of the context menu end with their message without a process and without an "IDE error occurred" notification. Record the results in design.md under a Verification section.
15+
16+
## Workflow follow-up
17+
18+
- Archive the change with `/opsx:archive` once it is implemented and committed.

0 commit comments

Comments
 (0)