Skip to content

Stop automatic syntax tests missing gaps (#398)#404

Merged
FichteFoll merged 2 commits intoSublimeText:masterfrom
camila314:master
Feb 16, 2025
Merged

Stop automatic syntax tests missing gaps (#398)#404
FichteFoll merged 2 commits intoSublimeText:masterfrom
camila314:master

Conversation

@camila314
Copy link
Contributor

@camila314 camila314 commented Feb 10, 2025

Fixes #398
Old Version (incorrectly assumes the space has numerical scopes):

 (123 456) /* ^^^^^^^^^ meta.group.c-2 */ /* ^ punctuation.section.group.begin */ /* ^^^^^^^ meta.number.integer.decimal.c-2 constant.numeric.value.c-2 */ /* ^ punctuation.section.group.end */```

New Version (correctly excludes space from numerical scopes):

 (123 456) /* ^^^^^^^^^ meta.group.c-2 */ /* ^ punctuation.section.group.begin */ /* ^^^ meta.number.integer.decimal.c-2 constant.numeric.value.c-2 */ /* ^^^ meta.number.integer.decimal.c-2 constant.numeric.value.c-2 */ /* ^ punctuation.section.group.end */

Simply checks if the previous region's end matches with the new region's beginning when inserting into a ScopeTreeNode.

@michaelblyons
Copy link
Contributor

michaelblyons commented Feb 10, 2025

I also recommend adding "Fixes #398” to the OP body text, since GitHub recognizes certain specific patterns as formal links between an issue and a PR.

Also consider changing the title to something like "Fix automatic syntax assertions filling gaps" or "Stop automatic syntax tests missing gaps". I think the way it is now it sounds backwards to me.

@camila314 camila314 changed the title Fix auto-generated syntaxes not filling gaps (#398) Stop automatic syntax tests missing gaps (#398) Feb 10, 2025
Copy link
Member

@FichteFoll FichteFoll left a comment

Choose a reason for hiding this comment

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

Thanks for taking a look at this issue and fixing it.

@FichteFoll FichteFoll merged commit 2c5b1b0 into SublimeText:master Feb 16, 2025
1 check passed
@FichteFoll FichteFoll added this to the 3.6.1 milestone Feb 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4 participants