Skip to content

fix(editor): find literals in the cleaned text when removing invisible characters - #4240

Merged
datlechin merged 3 commits into
mainfrom
fix/invisible-remover-name-rule
Nov 12, 2026
Merged

datlechin merged 3 commits into
mainfrom
fix/invisible-remover-name-rule

Conversation

@datlechin

Copy link
Copy Markdown
Member

Summary

  • Remove Invisible Characters finds literals in the text as it has cleaned it so far, the text that runs. SELECT<NBSP>E'a\'<NBSP>b' on PostgreSQL becomes SELECT E'a\'<NBSP>b': the second NBSP is string data. Since fix(editor): end a name where the engine does before E'' and $$, keep a one-statement routine body from swallowing the script, and step Vim by character #4236 the remover read the raw text, where PostgreSQL continues the name through the NBSP, and cleaned inside the string.
  • The same holds for a $$ body after a non-ASCII blank, a line separator before E', and a removed character between a blank and E'.
  • The lexer and every gate are unchanged: Safe Mode, MCP and statement splitting read the cleaned text with the engine's rule. Only this editor command reads the remover's lexing.

Test plan

  • InvisibleCharacterRemoverTests.postgresEscapeStringAndNestedComment fails on main and passes here.
  • Changed: dollarQuoteBehindABlankIsCode (from fix(editor): keep reading the keyword behind an invisible character #3025) pinned the raw reading, which rewrote a $$ body the cleaned text runs as a string. Now dollarQuoteBehindABlankKeepsItsBody.
  • New: lineSeparatorBeforeEscapeString, removedCharacterBeforeEscapeString.
  • Whole Unit plan on main: 31326 cases, this one the only failure. TableProCore SQL grammar and PluginKit tests pass.

@datlechin
datlechin merged commit 2fba4a0 into main Nov 12, 2026
1 check passed
@datlechin
datlechin deleted the fix/invisible-remover-name-rule branch November 12, 2026 17:14
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