Skip to content

fix: ruler improvements for fixed-format SQL continuation, stale decoration, and Source Change Date overlap#495

Open
bobcozzi wants to merge 3 commits into
codefori:mainfrom
bobcozzi:fix/ruler-sql-continuation-stale-decoration
Open

fix: ruler improvements for fixed-format SQL continuation, stale decoration, and Source Change Date overlap#495
bobcozzi wants to merge 3 commits into
codefori:mainfrom
bobcozzi:fix/ruler-sql-continuation-stale-decoration

Conversation

@bobcozzi
Copy link
Copy Markdown
Contributor

@bobcozzi bobcozzi commented Apr 7, 2026

Summary

Three related fixes to the Shift+F4 fixed-format spec ruler in columnAssist.ts.

Fixed

1. Ruler incorrectly shown on legacy embedded SQL continuation lines

Column 7 = + marks a C spec SQL continuation line (e.g. .....C+ FROM qiws.qcustcdt;). The ruler guard already skipped * (comments) and / (directives) but not +, so the C-spec ruler was incorrectly painted on those lines. Extended the guard to return early for + as well.

2. Ruler persists when the Cmd+Shift+F4 Column Assistant opens

onDidChangeTextEditorSelection does not fire while a webview panel has focus, so the ruler decoration stayed frozen on the source line until the user moved the cursor after closing the prompter. Added a window.onDidChangeActiveTextEditor subscription that immediately clears the ruler from the last RPG editor whenever focus moves away (to a webview or another file).

3. Ruler background overlaps Source Change Date columns

The ruler decoration used width: 100vw with an opaque background-color, which painted over the Source Change Date text that IBM i source physical files carry in columns 81–92. Changed the width to 80ch to cap the background at the fixed-format source width.

@bobcozzi bobcozzi force-pushed the fix/ruler-sql-continuation-stale-decoration branch from 83ea055 to 23c8efd Compare April 7, 2026 14:20
@sebjulliand sebjulliand linked an issue Apr 7, 2026 that may be closed by this pull request
@sebjulliand sebjulliand requested a review from a team April 7, 2026 20:52
@sebjulliand sebjulliand added the bug Something isn't working label Apr 7, 2026
Copy link
Copy Markdown
Member

@worksofliam worksofliam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good change but small issue

// Tracks the last RPG fixed-format editor that had the ruler painted, so it can
// be cleared when focus moves to a webview (e.g. Ctrl+Shift+F4 prompter) or to
// a non-RPG file, where onDidChangeTextEditorSelection never fires.
let lastRpgleEditor: import('vscode').TextEditor | undefined = undefined;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't use import like this in this project. Add it in an import at the top of the file

…ration, and Source Change Date overlap

- Skip Shift+F4 ruler on legacy embedded SQL continuation lines (col 7 = '+')
- Clear ruler immediately when active editor changes (e.g. Cmd+Shift+F4 webview opens)
  so the decoration does not remain frozen over the source
- Cap ruler background width at 80ch to avoid painting over Source Change Date
  columns that IBM i source physical files carry beyond column 80
@bobcozzi bobcozzi force-pushed the fix/ruler-sql-continuation-stale-decoration branch from 23c8efd to d994c6b Compare May 7, 2026 11:35
@worksofliam
Copy link
Copy Markdown
Member

@bobcozzi very sorry, but I just merged a PR that altered the same file (and added some OPM support). If you fix the conflicts one more time, I can test and merge.

@bobcozzi
Copy link
Copy Markdown
Contributor Author

Should be good now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inline Editor Helper problem

3 participants