Skip to content

fix: fix JSON within core commands and update highlighting#30

Merged
davem-intersys merged 1 commit intointersystems:mainfrom
hkimura-intersys:syntax-fix
Mar 22, 2026
Merged

fix: fix JSON within core commands and update highlighting#30
davem-intersys merged 1 commit intointersystems:mainfrom
hkimura-intersys:syntax-fix

Conversation

@hkimura-intersys
Copy link
Copy Markdown
Collaborator

@hkimura-intersys hkimura-intersys commented Mar 22, 2026

Overview

A bug was found where the return statement wasn't parsing JSON objects correctly. This PR fixes that bug and updates highlighting.

Details

The return statement wasn't being parsed correctly (this was a special case where the scanner was messing up and registered { as an argumentless loop, when it shouldn't since it is json):
image

This led me to realize this should be fixed for many of the commands. I added a new function 
build_command_rule_argumentful_block_allowed to core that doesn't register { as a block, and thus parses json objects as expected.

This new function replaces build_command_rule_argumentful for the following commands: write,lock,read,open,close,use,throw,break,return,quit,goto,hang,xecute,view,
zkill,zn,zsu,ztrap,zwrite,zz.

With this change, JSON objects are parsed as expected:
image

Highlighting Updates

  • Mirrored the way JSON is highlighted in its tree-sitter grammar by highlighting keys differently than values.

Testing

See the corresponding workflows:

@hkimura-intersys hkimura-intersys self-assigned this Mar 22, 2026
@davem-intersys davem-intersys merged commit a60196e into intersystems:main Mar 22, 2026
11 checks passed
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.

2 participants