RuleEdit: A .rule file editing tool
Posted: July 2nd, 2026, 10:15 am
I started working on an .rule file editor a long time ago, but I didn't have enough time to make good progress so it's been sitting in my files in an early development stage for quite a while. I knew I wouldn't be able finish the project without other people's help, so I decided to post about it here.
GitHub repo: https://github.com/I6-I6/RuleEdit
To try it yourself, run it locally using Vite:
Here's a brief explanation on how RuleEdit works so you don't have to figure it out yourself:
It was built using CodeMirror 6 and written in JavaScript.
Whenever the user alters something in the text field, the text is sent to analyzer.js, which then scans through the text section by section. It returns an object containing an array of diagnostics (i.e. issues), an array of tokens (info on how to style the text) and the rule name. renderer.js takes this and applies everything.
Current features
Underline diagnostics:
Things to add
GitHub repo: https://github.com/I6-I6/RuleEdit
To try it yourself, run it locally using Vite:
Code: Select all
git clone https://github.com/I6-I6/RuleEdit.git
cd RuleEdit
npm install
npm run devIt was built using CodeMirror 6 and written in JavaScript.
Whenever the user alters something in the text field, the text is sent to analyzer.js, which then scans through the text section by section. It returns an object containing an array of diagnostics (i.e. issues), an array of tokens (info on how to style the text) and the rule name. renderer.js takes this and applies everything.
Current features
Underline diagnostics:
- Errors: Guaranteed crash; solid red underline
- Warnings: Potential crash; solid orange underline
- Hints: Not a crash, but helpful information (such as omitting duplicates); dotted green underline
- Section headers: light blue
- Comments: italicized gray
- Keywords: pinkish red
- Numbers: tan
- Variables: orange
Things to add
- Finish logic for the rest of analyze.js
- Display diagnostic messages at the bottom (diagnostics-panel element). Click on them to jump to the line. Add buttons to ignore/quick fixes.
- Autocorrect/autocomplete/suggestions popups
- Import/export .rule files
- Table-to-tree & tree-to-table shortcuts
- Rulestring-to-table/tree shortcuts
- Color picker for @COLORS and @ICONS
- Drawing & import images features for @ICONS
- Rule preview (maybe) (using LV?)