From ba0ebef9a1bc77b0985ae3771b278cc6912157f7 Mon Sep 17 00:00:00 2001 From: Bronley Plumb Date: Wed, 6 Nov 2024 09:04:15 -0500 Subject: [PATCH] Fix bug with m.top colorization --- src/grammar/brightscript.tmLanguage.spec.ts | 21 +++++++++++++++++++++ syntaxes/brightscript.tmLanguage.json | 2 +- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/src/grammar/brightscript.tmLanguage.spec.ts b/src/grammar/brightscript.tmLanguage.spec.ts index aa31da12..99a369be 100644 --- a/src/grammar/brightscript.tmLanguage.spec.ts +++ b/src/grammar/brightscript.tmLanguage.spec.ts @@ -31,6 +31,27 @@ describe('brightscript.tmlanguage.json', () => { `); }); + it('does not color `top` as a variable name', async () => { + await testGrammar(` + top = true + '^^^ entity.name.variable.local.brs + `); + }); + + it('does not color `top` when part of another variable name', async () => { + await testGrammar(` + m.top1 = true + ' ^^^^ variable.other.object.property.brs + '^ keyword.other.this.brs + `); + + await testGrammar(` + m.1top = true + ' ^^^^ variable.other.object.property.brs + '^ keyword.other.this.brs + `); + }); + it('colors alias statement properly', async () => { await testGrammar(` alias alpha = beta diff --git a/syntaxes/brightscript.tmLanguage.json b/syntaxes/brightscript.tmLanguage.json index b52646a7..cc429074 100644 --- a/syntaxes/brightscript.tmLanguage.json +++ b/syntaxes/brightscript.tmLanguage.json @@ -657,7 +657,7 @@ "name": "keyword.other.this.brs" } }, - "match": "(?i:(?