Skip to content

Commit 4c6152b

Browse files
committed
Update documentation for features added since 0.8.0
Document the verify/run simulator integration, three-scope column alignment with grid-array exclusions, well/group name completion, boilerplate completion, and diagnostic quick fixes across the extension README, DEVELOPMENT, and the demo video script. - README: add formatting settings entry and Unreleased release notes - DEVELOPMENT: refresh src module layout, builder test, build/sync scripts - VIDEO-SCRIPT: add verify/run/PRT clip plus quick-fix and snippet takes
1 parent 35c6732 commit 4c6152b

4 files changed

Lines changed: 112 additions & 11 deletions

File tree

DEVELOPMENT.md

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,27 @@ opm-flow-editor-support/
99
│ # opm/input/eclipse/share/keywords)
1010
├── scripts/ # keyword-index builder (Python)
1111
│ ├── build_keyword_index.py
12+
│ ├── test_build_keyword_index.py # pytest suite for the builder
1213
│ └── requirements.txt
14+
├── demo-decks/ # runnable sample decks + VIDEO-SCRIPT.md walkthrough
15+
├── examples/ # small decks illustrating single features
1316
└── vscode-extension/ # the VS Code extension
14-
├── src/extension.ts
17+
├── src/
18+
│ ├── extension.ts # activation, command + provider wiring
19+
│ ├── analysis.ts # deck parsing + diagnostics engine
20+
│ ├── boilerplate.ts # keyword-completion snippet bodies
21+
│ ├── names.ts # well/group name harvesting (WELSPECS/GRUPTREE)
22+
│ ├── udq.ts # UDQ / ACTIONX recognition + metadata
23+
│ ├── formatting.ts # Align Record Columns / Add Column Headers
24+
│ ├── align-exclusions.ts # keywords skipped by the deck-wide align sweep
25+
│ ├── diagnostics-exclusions.ts
26+
│ ├── keyword-supplement.ts # deck-name alias / family resolution
27+
│ ├── links.ts # INCLUDE/IMPORT/RESTART/GDFILE file links
28+
│ ├── paths.ts # PATHS alias expansion + path resolution
29+
│ ├── outline.ts # section/keyword tree view
30+
│ ├── simulator.ts # Verify Deck / Run Simulation (optional)
31+
│ └── *.test.ts # Jest unit tests, one per module
32+
├── scripts/sync-manual-ref.js # stamps the manual commit into README
1533
├── syntaxes/opm-flow.tmLanguage.json
1634
├── language-configuration.json
1735
├── data/keyword_index_compact.json
@@ -62,6 +80,14 @@ npm test # all unit tests
6280
npx jest analysis # a single suite
6381
```
6482

83+
The Python keyword-index builder has its own pytest suite:
84+
85+
```sh
86+
cd scripts
87+
pip install -r requirements.txt
88+
python -m pytest test_build_keyword_index.py
89+
```
90+
6591
### Corpus false-positive harness
6692

6793
`src/corpus.test.ts` runs the diagnostics engine over the
@@ -98,6 +124,18 @@ python build_keyword_index.py \
98124
--compact ../vscode-extension/data/keyword_index_compact.json
99125
```
100126

127+
Or run the wrapper from the extension, which writes the compact index in place:
128+
129+
```sh
130+
cd vscode-extension
131+
npm run build-index
132+
```
133+
134+
`vscode-extension/README.md` carries the manual commit it was built from inside a
135+
`<!-- manual-ref:start -->` marker. `npm run sync-manual-ref` (also part of
136+
`vscode:prepublish`) stamps the current `opm-reference-manual` submodule commit
137+
into that marker, so the listing always shows the data revision being shipped.
138+
101139
## Release
102140

103141
Releases are tag-driven. On pushing a `v*` tag, CI:

demo-decks/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ without any external files.
1010

1111
| Folder | Deck | Feature focus |
1212
|--------|------|---------------|
13-
| `01-spe1-basics/` | `SPE1CASE1.DATA` | Highlighting, section/keyword folding, hover, diagnostics, completion, **Align Record Columns**, **Add Column Headers**, docs sidebar, Generate Keyword Reference |
13+
| `01-spe1-basics/` | `SPE1CASE1.DATA` | Highlighting, section/keyword folding, hover, diagnostics + quick fixes, completion (boilerplate snippets), **Align Record Columns**, **Add Column Headers**, docs sidebar, Generate Keyword Reference, **Verify Deck** / **Run Simulation** + **Open PRT File** |
1414
| `02-udq-actionx/` | `UDQ_WCONPROD.DATA`, `ACTIONX_M1.DATA` | UDQ three-column alignment, UDQ/ACTIONX recognition + hover, value completion |
1515
| `03-includes-and-names/` | `TEST1_WS.DATA` | `Ctrl+click` `INCLUDE` navigation, well/group-name completion from `WELSPECS`/`GRUPTREE` |
1616
| `04-msw-multirecord/` | `MSW-SIMPLE.DATA` | Multi-record keyword hover (`WELSEGS`/`COMPSEGS`), per-record **Add Column Headers**, `PATHS` alias navigation |

demo-decks/VIDEO-SCRIPT.md

Lines changed: 52 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ be trimmed and reordered later.
1313
4. Recommended look: a dark theme, editor font ~16 px, zoom level +1
1414
(`Ctrl+=` once), minimap off, breadcrumbs on.
1515
5. Hide personal panels; keep the Explorer visible on the left.
16+
6. *(Only for Clip 6 — running the simulator.)* Install OPM Flow and point the
17+
extension at it in Settings: set `opm-flow.simulator.executablePath`. On
18+
Windows, enable `opm-flow.simulator.useWsl` and use the Linux path (e.g.
19+
`/usr/bin/flow`), optionally setting `opm-flow.simulator.wslDistribution`.
20+
Verify it works once off-camera so the first on-camera run is clean.
1621

1722
Pacing tips: move the cursor deliberately, pause ~1 s on each tooltip so it is
1823
readable, and let folds/alignments settle before cutting.
@@ -45,13 +50,17 @@ readable, and let folds/alignments settle before cutting.
4550

4651
- **Take 5 — Completion.** At the end of `SCHEDULE`, on a new line in column 1,
4752
type `WCON` — the keyword completion list appears with sections and one-line
48-
summaries. Then inside a fresh `COMPDAT` record, at the STATUS column, trigger
49-
completion to show the value list (`OPEN` / `SHUT` / `AUTO`). *(Undo any typing
50-
before the next take with `Ctrl+Z`.)*
53+
summaries. Accept `WCONPROD`: it inserts a **boilerplate record** as a
54+
tab-navigable snippet (documented defaults / typed placeholders, terminated to
55+
match the keyword's shape). `Tab` through a couple of placeholders to show they
56+
overwrite cleanly. Then inside a fresh `COMPDAT` record, at the STATUS column,
57+
trigger completion to show the value list (`OPEN` / `SHUT` / `AUTO`). *(Undo any
58+
typing before the next take with `Ctrl+Z`.)*
5159

5260
- **Take 6 — Align Record Columns.** Put the cursor inside the `SWOF` table (or
53-
the `WELSPECS` block). Run **OPM Flow: Align Record Columns** from the Command
54-
Palette (`Ctrl+Shift+P`). Columns snap into alignment. Show the before/after.
61+
the `WELSPECS` block). Run **OPM Flow: Align Record Columns in Record** from the
62+
Command Palette (`Ctrl+Shift+P`). Columns snap into alignment. Show the
63+
before/after. *(Mention the companion **… in File** and **… in Deck** scopes.)*
5564

5665
- **Take 7 — Add Column Headers.** With the cursor in the `COMPDAT` block, run
5766
**OPM Flow: Add Column Headers**. A `--` comment with parameter names is
@@ -83,6 +92,13 @@ camera, then `Ctrl+Z` each one back.
8392
- **Take 5 — Missing terminator.** Delete the trailing `/` on a `WELSPECS`
8493
record. Squiggle flags the missing per-record `/`.
8594

95+
- **Take 6 — Quick Fixes.** Re-create one of the fixable mistakes above (e.g.
96+
lowercase `compdat`, or an indented `WCONPROD`, or the missing `/`). Place the
97+
cursor on the squiggle, open the lightbulb (`Ctrl+.`), and apply the offered
98+
fix — **Convert to uppercase** / **Move keyword to column 1** / **Add
99+
terminating `/`**. For an unknown keyword like `EQLDIM`, show the **Replace with
100+
`EQLDIMS`** fix substituting the nearest known keyword.
101+
86102
Undo everything so the file is clean for the next session.
87103

88104
---
@@ -93,7 +109,7 @@ Undo everything so the file is clean for the next session.
93109

94110
- **Take 1 — UDQ alignment (`UDQ_WCONPROD.DATA`, `UDQ` block ~line 349).**
95111
Show the `UDQ` block with `DEFINE … / UNITS …` statements slightly ragged.
96-
Run **OPM Flow: Align Record Columns**. The dedicated three-column layout
112+
Run **OPM Flow: Align Record Columns in Record**. The dedicated three-column layout
97113
appears: control word and variable name left-aligned, expression right-aligned
98114
so every terminating `/` lines up. Point out that a `/` used as division inside
99115
an expression is **not** mistaken for the terminator.
@@ -150,8 +166,33 @@ Undo everything so the file is clean for the next session.
150166
record the group belongs to (e.g. `ISEG1`, `ISEG2`, …). Repeat in the
151167
`COMPSEGS` block (~line 479) to show it adapts per keyword.
152168

153-
- **Take 4 — Align the segment table.** Run **Align Record Columns** on the
154-
`WELSEGS` segment block to tidy the long numeric rows.
169+
- **Take 4 — Align the segment table.** Run **Align Record Columns in Record** on
170+
the `WELSEGS` segment block to tidy the long numeric rows.
171+
172+
---
173+
174+
## Clip 6 — Verify & run the simulation (file `01-spe1-basics/SPE1CASE1.DATA`)
175+
176+
**Goal:** show that you can check and run a deck with OPM Flow without leaving the
177+
editor. *(Requires the off-camera simulator setup — step 6 above.)* SPE1 is the
178+
small SPE benchmark case, so a full run finishes in seconds on camera.
179+
180+
- **Take 1 — Verify Deck (dry run).** With `SPE1CASE1.DATA` open, run **OPM Flow:
181+
Verify Deck (dry run)** from the right-click menu (or Command Palette). An
182+
integrated terminal opens in the deck's folder and `flow` parses and
183+
initializes the model in dry-run mode — no time steps. Point out this is the
184+
fast check that the deck and everything it pulls in via `INCLUDE` / `PATHS`
185+
loads cleanly. *(On Windows, note the path was translated to its `/mnt/...`
186+
WSL mount automatically.)*
187+
188+
- **Take 2 — Run Simulation.** Run **OPM Flow: Run Simulation**. The same
189+
terminal streams the live solver output to completion. Let the report counters
190+
tick to the end of the run.
191+
192+
- **Take 3 — Open the PRT output.** Run **OPM Flow: Open PRT File** (or
193+
`Ctrl+Alt+P`). The `SPE1CASE1.PRT` print file that the run just produced opens
194+
next to the deck. Scroll briefly to show the run summary. *(Good closing shot —
195+
"edit, verify, run, inspect, all in one place".)*
155196

156197
---
157198

@@ -166,4 +207,6 @@ Undo everything so the file is clean for the next session.
166207
7. `Ctrl+click` INCLUDE jump (Clip 4 / Take 1).
167208
8. Well-name completion list (Clip 4 / Take 2).
168209
9. WELSEGS per-record headers (Clip 5 / Take 3).
169-
10. Close on Generate Keyword Reference (Clip 1 / Take 8).
210+
10. Verify Deck dry-run in the terminal (Clip 6 / Take 1).
211+
11. Run Simulation to completion → Open PRT File (Clip 6 / Takes 2–3).
212+
12. Close on Generate Keyword Reference (Clip 1 / Take 8).

vscode-extension/README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,12 @@ you can override them per-workspace or per-folder.
379379
| --- | --- | --- |
380380
| `opm-flow.additionalFileExtensions` | `[]` | Extra file extensions (with or without a leading `.`) to open as OPM Flow on top of the built-in list. Useful for project-specific include-file conventions. Matched case-insensitively. Example: `[".myinc", "wellconv"]`. For one-off cases the VS Code-native `files.associations` setting still works too. |
381381

382+
### Formatting
383+
384+
| Setting | Default | Description |
385+
| --- | --- | --- |
386+
| `opm-flow.formatting.alignColumnsExcludedKeywords` | `[]` | Extra keywords to skip when aligning record columns. Names are upper-cased on read; matching is case-insensitive. Honoured by all three [Align Record Columns](#align-record-columns) commands, and *added* to the built-in deck-sweep defaults (per-cell grid/region arrays like `PORO`/`PERMX`/`COORD` and large `VFPPROD`/`VFPINJ` tables, which **Align … in Deck** already skips). |
387+
382388
### Simulator
383389

384390
Optional integration for the [Verify and Run](#verify-and-run-the-simulation-optional)
@@ -451,6 +457,20 @@ The language is registered as `opm-flow`.
451457

452458
### Unreleased
453459

460+
- **Align Record Columns at three scopes** — the alignment command is now split
461+
into **Align Record Columns in Record** (the group under the cursor), **… in
462+
File** (the whole document, or the selection), and **… in Deck** (follows the
463+
`INCLUDE` chain, resolving `PATHS` aliases, and aligns every reachable file,
464+
reporting the line/file counts). The deck sweep skips per-cell grid/region
465+
arrays (`PORO`, `PERMX`, `COORD`, …) and large `VFPPROD`/`VFPINJ` tables by
466+
default so `INCLUDE`d fixed-width files are not rewritten; the new
467+
`opm-flow.formatting.alignColumnsExcludedKeywords` setting adds further
468+
keywords to skip (honoured by all three commands).
469+
- **Well / group name completion** — in a well- or group-name column (the
470+
opm-common `WELL`/`GROUP` item family — `WCONPROD`, `WELOPEN`, `GCONPROD`,
471+
`WEFAC`, …) the suggestion list offers the names the deck already declares:
472+
well names from `WELSPECS`, and group names from `WELSPECS` and `GRUPTREE`,
473+
gathered across the whole file.
454474
- **Verify and run the simulation (optional)** — new **OPM Flow: Verify Deck
455475
(dry run)** and **OPM Flow: Run Simulation** commands launch a locally
456476
installed `flow` binary on the open deck in an integrated terminal. Verify uses

0 commit comments

Comments
 (0)