Conversation
…dies - Change NULL/TRUE/FALSE/UNKNOWN and EXTRACT field names from entity.name.label to constant.language so themes highlight them - Add CASCADE and RESTRICT to keyword_dml so they highlight in TRUNCATE ... CASCADE/RESTRICT (previously only in keyword_ddl, which dml_statement intentionally excludes) - Remove keyword_ddl from dollar_quotes context (PL/pgSQL function bodies); replace keywords_all with explicit keyword_dml + keyword_control + keyword_other — prevents column names like output, value, data from being highlighted as DDL keywords inside function bodies
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
NULL/TRUE/FALSE/UNKNOWNnot highlighted — scope wasentity.name.label.pgsql(unstandardised, most themes don't style it); changed toconstant.language.pgsql. Same fix applied toEXTRACTfield names (EPOCH,YEAR,MONTH, etc.).CASCADE/RESTRICTnot highlighted inTRUNCATE— these were only inkeyword_ddl, whichdml_statementintentionally excludes to avoid false positives on column names; added them tokeyword_dmlinstead.output,value,datahighlighted as DDL keywords inside PL/pgSQL function bodies —dollar_quoteswas includingkeywords_all(which bundleskeyword_ddl); replaced with explicitkeyword_dml + keyword_control + keyword_other, matching the same rationale already applied todml_statement.Test plan
npm test— all 480 assertions passnpm run validate— 0 unscoped tokens across all samplesnpm run validate-sql— all statements parse via libpg-querynpm run preview:NULL/TRUE/FALSEhighlighted as constants,CASCADEhighlighted inTRUNCATE,outputcolumn name unstyled in PL/pgSQL INSERT