fix: update highlights, injections, and reformat grammar#23
Open
hkimura-intersys wants to merge 3 commits intointersystems:mainfrom
Open
fix: update highlights, injections, and reformat grammar#23hkimura-intersys wants to merge 3 commits intointersystems:mainfrom
hkimura-intersys wants to merge 3 commits intointersystems:mainfrom
Conversation
- Updated highlighting that is much faster and has better practices. This along with the grammar restructure made it so any future updates will be significantly easier.
- Made the capture names according to the zed standard (so themes can pick them up )
- Updated injections for xdata to allow yaml
- Removed all fields and added a keyword field for all objectscript structures/command names
- Fixed global variable in expression grammar to allow for something like ^|"SAMPLES","IRISLIB"|patient(1), which before gave an error
- Complete refactor of all three grammars to follow best practices and lower parser.c file size while also giving the necessary information needed for LS and good highlighting
- Added 437 unit tests to the expr grammar
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.
Overview
This PR refactors the three ObjectScript grammars (
core,expr,udl), standardizes highlight and injection queries, and substantially expands grammar test coverage.Key Changes
text/yamlandapplication/yaml) in addition to existing mime types.keywordfields at usage sites (statements/structures/commands).^|"SAMPLES","IRISLIB"|patient(1)parse correctly.core,expr, andudlto improve consistency and long-term maintainability while preserving language-server/highlighting utility.Key Changes
text/yamlandapplication/yaml) in addition to existing mime types.keywordfields at usage sites (statements/structures/commands).^|"SAMPLES","IRISLIB"|patient(1)parse correctly.core,expr, andudlto improve consistency and long-term maintainability while preserving language-server/highlighting utility.Highlights by Area
Highlight Queries
Updated:
expr/queries/highlights.scmcore/queries/highlights.scmudl/queries/highlights.scmbindings/python/tree_sitter_objectscript_core/queries/highlights.scmResult:
Injection Queries
core/queries/injections.scmudl/queries/injections.scmGrammar Restructure
core/grammar.jsexpr/grammar.jsudl/grammar.jsudl/keywords.jsTest Coverage Expansion
expr/test/corpus/for broad builtin/system/macro/global/extrinsic coverage.core/test/corpus/*andudl/test/corpus/*trees to align with grammar/query refactors and new parsing behavior.Added Documentation
docs/c4.mddocs/arc42.mddocs/design-doc.mddocs/code-health-report.mddocs/usage-examples.mddocs/data-structures/*.mdexpression,statement,class_definition,method_definition)Why This Documentation Helps
For Contributors:
expr→core→udl) and why it existsFor Users/Integrators:
For Maintainers:
TESTING
Overview: To test these changes, I ran all the unit tests, tested all the injections, and tested highlighting in
tree-sitter playground.Unit Tests
Verified all tests are passing in all 3 grammars:



Tested Injections:
Tested highlighting updates:
Foreignkey:

Index:

Method:

Parameter:

Projection:

Property:

Query:

Relationship:

Trigger:
