You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/concepts.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -53,7 +53,7 @@ flowchart LR
53
53
54
54
**Sequential mode** (default): handlers run one after another. Each handler can read the accumulated result so far via `context.current_result`. Useful when handlers depend on each other's output (e.g. formatter → save-to-disk).
55
55
56
-
**Concurrent mode** (`run_handlers_concurrently: true`): all handlers run in parallel and results are merged afterward. Accessing `context.current_result` in concurrent mode raises `RuntimeError`. Useful for independent linters.
56
+
**Concurrent mode** (`HANDLER_EXECUTION = HandlerExecution.CONCURRENT`): all handlers run in parallel and results are merged afterward. Accessing `context.current_result` in concurrent mode raises `RuntimeError`. Useful for independent linters.
Copy file name to clipboardExpand all lines: docs/glossary.md
+8Lines changed: 8 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,10 @@ A named operation (for example `lint`, `format`, `build_artifact`).
8
8
9
9
A concrete implementation of an action. Multiple handlers can be registered for a single action, and they run sequentially or concurrently.
10
10
11
+
## Collection Action
12
+
13
+
An action whose payload carries multiple items and whose result describes that batch, often with per-item entries. Used when handlers need to iterate over, correlate, or optimize across the full set of items.
14
+
11
15
## Execution Environment
12
16
13
17
A named, isolated context in which handlers and project code execute (e.g. `runtime`, `dev_workspace`, `dev_no_runtime`). Each execution environment has its own dependency set, serving a specific purpose — for example, the project's runtime, dev tooling, or test execution. The concept is inter-language; in Python each execution environment is materialized as a virtual environment. Configuration uses the shorthand `env`.
@@ -16,6 +20,10 @@ A named, isolated context in which handlers and project code execute (e.g. `runt
16
20
17
21
A process that runs inside a specific execution environment and executes action handler code. The Workspace Manager spawns one ER per (project, execution environment) pair, on demand. ERs communicate with the WM over JSON-RPC. The concept is inter-language — `finecode_extension_runner` is the Python implementation.
18
22
23
+
## Item Action
24
+
25
+
An action whose payload carries one item and whose result describes that one item. Used when handlers naturally operate on a single unit of work.
26
+
19
27
## Preset
20
28
21
29
A reusable, distributable bundle of action and handler declarations. Users reference a preset in their project configuration; its declarations merge with the project's own configuration, giving full control to override or disable individual handlers. The concept is inter-language — in Python, presets are distributed as packages installed into the `dev_workspace` execution environment.
Copy file name to clipboardExpand all lines: docs/reference/actions.md
+41-7Lines changed: 41 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -62,7 +62,7 @@ Format a source artifact or specific files.
62
62
|`file_paths`|`list[Path]`|`[]`| Files to format (required when `target="files"`) |
63
63
64
64
!!! note
65
-
The `save` payload field controls whether changes are written to disk. The built-in `SaveFormatFilesHandler` reads this flag. If you omit the save handler from your preset, files won't be written regardless.
65
+
The `save` payload field controls whether changes are written to disk. The built-in `SaveFormatFileHandler` reads this flag. If you omit the save handler from your preset, files won't be written regardless.
66
66
67
67
---
68
68
@@ -73,20 +73,54 @@ Format a specific set of files. Internal action dispatched by `format`.
The built-in `FormatFilesDispatchHandler` groups the given files by language and dispatches each language's batch to the matching language subaction — any action declaring `PARENT_ACTION = FormatFilesAction` and the corresponding `LANGUAGE`.
76
+
The built-in `FormatFilesIterateHandler` iterates over all files and delegates each to `format_file`. Language routing is handled by `format_file` via its dispatch handler — `format_files` has no language awareness.
77
77
78
78
---
79
79
80
-
## `format_python_files`
80
+
## `format_file`
81
81
82
-
Format Python source files. Language-specific subaction of `format_files`.
82
+
Format a single file. Item-level action; handlers run sequentially as a pipeline.
|`file_editor_session`|`IFileEditorSession \| None`|`None`| Shared session from a parent action. If absent, the context opens its own. |
99
+
|`file_info`|`FileInfo \| None`|`None`| Pre-read file content. If absent, the context reads the file itself (with `block=True`). |
100
+
101
+
When called standalone (e.g. IDE on-save), no kwargs are needed — the context creates its own session and reads the file. When called from `format_files`, the iterate handler passes the parent session. When called from the dispatch handler into a language subaction, both session and file info are passed to avoid redundant reads.
102
+
103
+
**Result fields:**
104
+
105
+
| Field | Type | Description |
106
+
|---|---|---|
107
+
|`changed`|`bool`| Whether the file content was modified |
108
+
|`code`|`str`| The formatted content |
109
+
110
+
Handlers read and update `run_context.file_info` to pass formatted content to the next handler in the pipeline.
111
+
112
+
---
113
+
114
+
## `format_python_file`
115
+
116
+
Format a single Python file. Language-specific item-level subaction of `format_file`.
0 commit comments