Skip to content

Bug fixes and test files for PR-535 (SQL keyword detection)#1

Merged
buzzia2001 merged 3 commits into
buzzia2001:fixErrorHighlightfrom
bobcozzi:pr-535
Jun 15, 2026
Merged

Bug fixes and test files for PR-535 (SQL keyword detection)#1
buzzia2001 merged 3 commits into
buzzia2001:fixErrorHighlightfrom
bobcozzi:pr-535

Conversation

@bobcozzi

Copy link
Copy Markdown

This PR adds bug fixes documentation and comprehensive test files for the SQL keyword detection enhancements in PR codefori#535.

What's included:

  • PR-535-Bug-Fixes.md - Detailed documentation of additional bug fixes found during testing
  • PR-535-Testing-Guide.md - Comprehensive testing guide with all test scenarios
  • Multiple test files covering various edge cases:
    • test_dcl_blocks.rpgle - DCL block handling
    • test_end_free_issue.rpgle - END statement issues
    • test_endproc_issue.rpgle - ENDPROC handling
    • test_mismatched_blocks.rpgle - Mismatched block detection
    • test_pr535_sql_keywords.rpgle - SQL keyword scenarios
    • test_variable_named_keywords.rpgle - Variables with keyword names
    • ASKDATE.RPGLE - Additional test case

These changes complement your original PR and help ensure the SQL keyword detection works correctly across all scenarios.

For the PR codefori#535 author

Please review and merge these commits into your fixErrorHighlight branch so they become part of PR codefori#535 on codefori/vscode-rpgle.

bobcozzi added 3 commits June 13, 2026 13:22
The isVariableContext() function was incorrectly treating ALL keywords
followed by '(' as variables, which broke normal control flow statements
like if (condition), dou (condition), and elseif (condition).

This fix now only treats a keyword followed by '(' as a variable if it's
also preceded by operators like '.', '(', or ',' that indicate it's being
used as a value in an expression.

Examples that now work correctly:
- if (condition) → KEYWORD (control flow)
- foo(end) → VARIABLE (end is function parameter)
- arr(if) → VARIABLE (if is array subscript)
- ds.end(x) → VARIABLE (end is DS field)

Fixes the ENDIF/ENDDO/ELSE highlighting errors in debug mode.
@buzzia2001 buzzia2001 merged commit f1cf355 into buzzia2001:fixErrorHighlight Jun 15, 2026
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.

2 participants