-
Notifications
You must be signed in to change notification settings - Fork 234
Fix Monaco bugs #773
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
Fix Monaco bugs #773
Conversation
@@ -158,7 +158,7 @@ module.exports = function(_, argv) { | |||
}), | |||
new MonacoWebpackPlugin({ | |||
filename: `${filenameTemplate}.worker.js`, | |||
languages: ['rust'], | |||
languages: [], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need their grammar because we use our own anyway. It should save some bits.
const MODE_ID = 'my-rust'; | ||
const MODE_ID = 'rust'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Somethings (like hover snippets) can not be set to use my-rust
. Not related to the issues, but still something that isn't correct.
In the future, please create separate commits (or separate PRs if applicable) and use the commit message to describe what the commit is doing and why. |
[/r"/, { token: 'string.quote', next: '@rawstring0' }], | ||
[/r#"/, { token: 'string.quote', next: '@rawstring1' }], | ||
[/r##"/, { token: 'string.quote', next: '@rawstring2' }], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Won't doing it this way only support raw strings with up to two #
s? The ace editor supports an unlimited amount of #
s, and I'd be amazed if this Monaco tokenizer engine wasn't built to offer up a way to match the starting #
s to the ending #
s.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This ought to do it (see also second suggestion below):
[/r"/, { token: 'string.quote', next: '@rawstring0' }], | |
[/r#"/, { token: 'string.quote', next: '@rawstring1' }], | |
[/r##"/, { token: 'string.quote', next: '@rawstring2' }], | |
[/r"/, { token: 'string.quote', next: '@rawstring0' }], | |
[/r(#+)"/, { token: 'string.quote', next: '@rawstring1.$1' }], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I applied your suggestion, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should allow an unlimited amount of #
usage in raw strings.
[/r"/, { token: 'string.quote', next: '@rawstring0' }], | ||
[/r#"/, { token: 'string.quote', next: '@rawstring1' }], | ||
[/r##"/, { token: 'string.quote', next: '@rawstring2' }], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This ought to do it (see also second suggestion below):
[/r"/, { token: 'string.quote', next: '@rawstring0' }], | |
[/r#"/, { token: 'string.quote', next: '@rawstring1' }], | |
[/r##"/, { token: 'string.quote', next: '@rawstring2' }], | |
[/r"/, { token: 'string.quote', next: '@rawstring0' }], | |
[/r(#+)"/, { token: 'string.quote', next: '@rawstring1.$1' }], |
Credits to @alexschord
fix #771
fix #770
fix #769