-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Smart indent matches partial command matches #133
Comments
I don't know if it'll help, but you can add a boundary anchor '))\\b.*\\s*$' |
Thanks Dan, I haven't yet had a chance to look at this (and many other bugs) in any great detail. Your suggestion certainly sounds feasible though, and I'd be very happy to take a PR ;) |
Sure, but you'll have to walk me through how to build it so I can test before pushing. 😅 |
There aren't actually any unit tests for ChoiceScript yet, because Monarch unit tests are extremely painful to write and I'm expecting a lot of churn in this area. There's documentation and a playground for Monarch (the grammar framework) here: https://microsoft.github.io/monaco-editor/monarch.html. That should get you going, but feel free to shout if you've got any more specific questions. Don't worry about the validation errors, they're from the language server (which is very buggy atm) rather than the tokenizer. |
The basic-language support in ChoicescriptIDE/monaco-editor defines the "smart" indentation behaviour based on RegExes.
Whilst implementing *ifid I noticed that it's incorrectly treated as a indenting command, because the 'if' part is matched.
Unfortunately this seems to extend to invalid commands as well, for e.g.:
*ifishouldnotiwouldnot
Will trigger an automatic indent.
The text was updated successfully, but these errors were encountered: