diff options
| author | _ov4 <ov4@ov4.org> | 2026-10-13 08:00:16 +0000 |
|---|---|---|
| committer | _ov4 <ov4@ov4.org> | 2026-10-13 08:00:16 +0000 |
| commit | 3d03ca5864f231f89d6b0b4c44f41275a8b93bf4 (patch) | |
| tree | f84daf8935020942d141e2812e08d0b7086fbb0f /plugin/test | |
| parent | efc6b3b27a0e15fd0ad65e883fda7929164546aa (diff) | |
fix(plugin): use C++ assignment highlighting for the arrow operator
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Diffstat (limited to 'plugin/test')
| -rw-r--r-- | plugin/test/highlighting.test.js | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/plugin/test/highlighting.test.js b/plugin/test/highlighting.test.js index 89e031a..24751bf 100644 --- a/plugin/test/highlighting.test.js +++ b/plugin/test/highlighting.test.js @@ -36,7 +36,7 @@ test('C++ style scopes distinguish keywords, types, literals, operators and buil ['X <- TRUE', 'TRUE', 'constant.language'], ['X <- 12.5', '12.5', 'constant.numeric'], ['X <- 2 DIV 1', 'DIV', 'keyword.operator.word'], - ['X <- 1', '<-', 'keyword.operator'], + ['X <- 1', '<-', 'keyword.operator.assignment.cpp'], ['OUTPUT "text"', 'text', 'string.quoted.double'], ["X <- 'A'", 'A', 'string.quoted.single'] ]) assert.ok(scopesAt(text, word).some(s => s.startsWith(scope)), text); @@ -46,6 +46,13 @@ test('C++ style scopes distinguish keywords, types, literals, operators and buil } }); +test('both assignment characters share the C++ assignment scope', () => { + const text = 'X <- 1'; + assert.deepEqual(scopesAt(text, '<-'), scopesAt(text, '-')); + assert.ok(!scopesAt('X < 1', '<').includes('keyword.operator.assignment.cpp')); + assert.ok(!scopesAt('X - 1', '-').includes('keyword.operator.assignment.cpp')); +}); + test('comments, strings, lowercase and keyword prefixes cannot become keywords', () => { assert.ok(scopesAt('// IF [(', 'IF').some(s => s.startsWith('comment.'))); assert.ok(scopesAt('OUTPUT "IF // ["', 'IF').some(s => s.startsWith('string.'))); |
