Skip to content
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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jiribenes
Copy link
Contributor

@jiribenes jiribenes commented Jul 20, 2024

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. 🙏

Comment on lines -69 to -72
var CLASS = {
className: 'class',
beginKeywords: 'class object trait type',
end: /[:={\[\n;]/,
Copy link
Contributor Author

@jiribenes jiribenes Jul 20, 2024

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.

@jiribenes
Copy link
Contributor Author

Hey @dvdvgt, if you get some time, could you just try if this highlighting looks okay to you on your local website build?

Copy link
Contributor

@dvdvgt dvdvgt left a 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).

Comment on lines 89 to 90
[/\/\*/, 'comment', '@push'],
["\\*/", 'comment', '@pop'],
Copy link
Contributor

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'],
Copy link
Contributor

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)

@jiribenes
Copy link
Contributor Author

I tried fixing the two outlined things, PTAL. 🙏

Copy link
Contributor

@dvdvgt dvdvgt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, still looks incomplete to me:

  • image
  • image

But I sadly don't know what the issue is here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants