-
Notifications
You must be signed in to change notification settings - Fork 5
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
Try to update syntax highlighting #59
base: master
Are you sure you want to change the base?
Conversation
1fea08d
to
a6eae04
Compare
var CLASS = { | ||
className: 'class', | ||
beginKeywords: 'class object trait type', | ||
end: /[:={\[\n;]/, |
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 don't think we really used this anywhere except for type
declarations so I merged the important parts with METHOD
to make DEFINITION
.
Hey @dvdvgt, if you get some time, could you just try if this highlighting looks okay to you on your local website build? |
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 seems to work just as before, but also does not fix some of the issue of the previous highlighter (see comments).
src/effekt-syntax.ts
Outdated
[/\/\*/, 'comment', '@push'], | ||
["\\*/", 'comment', '@pop'], |
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.
Apparently this does not work (as before):
/*
* Used as a type for `Exception` in functions which expect a non-empty
* container (e.g. option or list).
*/
record MissingValue()
Here, the lines following beyond the */
are also greyed out
], | ||
|
||
bracketCounting: [ | ||
[/\{/, 'delimiter.bracket', '@bracketCounting'], |
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 does seem to get confused on this example:
extern io def panic[R](msg: String): R =
js "${ msg ++ "{42}"}"
Here, the 42
is coloured like a literal (blue) while it should coloured like a string (green)
I tried fixing the two outlined things, PTAL. 🙏 |
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.
Warning
This has NOT been tested!
In sync with effekt-lang/effekt-vscode#18, let's try to update the syntax files a little bit.
Here I attempted to keep things mostly as they are, remove extremely outdated parts and port (at least some of) the changes from effekt-lang/effekt-vscode#18.
Also, sorry for the wrong push in 8927cc8. 🙏