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

Better syntax highlighting for Dart #1959

Merged

Conversation

Aelerinya
Copy link
Contributor

Closes #1958

This PR changes the dart highlighting source package to elMuso/Dartlight.

This fixes the bug mentioned in the issue. I added a syntax test to check that comments in function calls are highlighted correctly.

However, the highlighting changes quite a bit. The two screenshots below show the difference :

Old:
Old Dart highlighting

New:
New Dart highlighting

Copy link
Collaborator

@keith-hall keith-hall left a comment

Choose a reason for hiding this comment

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

Looks good to me. Maybe you want to update the changelog so other users will know about the change? You can check the contribution guide for details :)

@Enselic
Copy link
Collaborator

Enselic commented Nov 28, 2021

What license is the new syntax under? It starts off as MIT but contains GPL license text afterwards: https://github.com/elMuso/Dartlight/blob/master/LICENSE

@Aelerinya
Copy link
Contributor Author

Aelerinya commented Nov 28, 2021

What license is the new syntax under? It starts off as MIT but contains GPL license text afterwards: https://github.com/elMuso/Dartlight/blob/master/LICENSE

For now, I opened an issue asking on the other repository what the license is. Sadly this is the only other package on Sublime Text providing Dart syntax highlighting support, so it was the only alternative to the broken and unmaintained one.

elMuso/Dartlight#6

@Aelerinya
Copy link
Contributor Author

Honestly, even if the new syntax is better, neither project seem very active nor up to date. The last release for the old one was 6 years ago, and the new one was 2 years ago. However, those two packages are the only one on sublime text providing syntax highlighting for Dart.

Is sublime text packages the only possible source for syntaxes for bat ? I suppose VSCode syntaxes are not supported even though they use the same highlighting engine ?

@keith-hall
Copy link
Collaborator

VS Code isn't using the same highlighting engine. But if you can convert a VSCode syntax definition to a PList/XML tmLanguage, then it can be used by bat (after another step to convert it to sublime-syntax)

@sharkdp
Copy link
Owner

sharkdp commented Nov 28, 2021

VS Code isn't using the same highlighting engine. But if you can convert a VSCode syntax definition to a PList/XML tmLanguage, then it can be used by bat (after another step to convert it to sublime-syntax)

Interesting - I didn't know that. To what extent is this possible? Is every VS Code syntax feature represented on the tmLanguage/sublime-syntax side? I.e. is this mapping complete (even if it's not reversible)? Is this something we should look into?

@keith-hall
Copy link
Collaborator

https://code.visualstudio.com/api/language-extensions/syntax-highlight-guide

It seems it may be necessary to convert from a JSON TextMate grammar to a PList, presumably they are interchangeable. Then it mainly depends on whether any new features were added to TextMate and whether Sublime's converter would need to be augmented to handle them.

@Aelerinya
Copy link
Contributor Author

What license is the new syntax under? It starts off as MIT but contains GPL license text afterwards: https://github.com/elMuso/Dartlight/blob/master/LICENSE

It is now fixed. The author of the repo put back the proper MIT license. elMuso/Dartlight#6

@Enselic
Copy link
Collaborator

Enselic commented Dec 5, 2021

@Ersikan Can you resolve the conflict please?

Copy link
Collaborator

@Enselic Enselic left a comment

Choose a reason for hiding this comment

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

Conflict was trivial, so I took care of it.

Thank you for your contribution!

@Enselic Enselic merged commit 29711c1 into sharkdp:master Dec 6, 2021
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.

Dart syntax highlighting
4 participants