Skip to content

Add boilerplate keyword completion and diagnostic quick fixes - #50

Merged
magnesj merged 1 commit into
OPM:mainfrom
magnesj:feature/boilerplate-completion-quickfixes
Jun 29, 2026
Merged

Add boilerplate keyword completion and diagnostic quick fixes#50
magnesj merged 1 commit into
OPM:mainfrom
magnesj:feature/boilerplate-completion-quickfixes

Conversation

@magnesj

@magnesj magnesj commented Jun 29, 2026

Copy link
Copy Markdown
Member

Summary

Two related editor features for OPM Flow decks:

  • Boilerplate keyword completion — accepting a keyword completion now inserts a sample data record as a tab-navigable snippet (typed placeholders or manual defaults, terminated to match the keyword's size_kind) instead of just the bare keyword name. A new opm-flow.completion.keywordInsert setting selects template (default) or name-only insertion.

  • Diagnostic quick fixes — diagnostics with an unambiguous correction now carry a stable code, and a CodeActionProvider offers one-click fixes:

    • uppercase a lowercase keyword,
    • move an indented keyword to column 1,
    • add a missing record / list / array terminator,
    • replace an unknown keyword with its nearest known match (Levenshtein-based suggestion).

Documentation (README feature sections, the new setting, and a release-notes entry) is included.

Notes

This ports the work from magnesj #20 onto current upstream main. The diagnostic code/suggestion additions attach to the existing diagnostic emission sites already present upstream.

Verification

  • npm run compile — clean
  • npm test — 235 passed, 6 suites

* Add boilerplate keyword completion and diagnostic quick fixes

Completing a keyword now inserts a sample data record as a tab-navigable
snippet (typed placeholders or manual defaults, terminated to match the
keyword's size_kind) instead of just the bare name. A new
opm-flow.completion.keywordInsert setting selects template or name-only.

Diagnostics with an unambiguous correction now carry a stable code, and a
CodeActionProvider offers one-click fixes: uppercase a lowercase keyword,
move a keyword to column 1, add a missing record / list / array terminator,
and replace an unknown keyword with its nearest known match.

* Document boilerplate completion and quick fixes

Add README feature sections for template keyword completion and diagnostic
quick fixes, the opm-flow.completion.keywordInsert setting, and an Unreleased
release-notes entry.
@magnesj
magnesj merged commit a6411f8 into OPM:main Jun 29, 2026
4 checks passed
@magnesj
magnesj deleted the feature/boilerplate-completion-quickfixes branch June 29, 2026 07:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant