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

Add support for the dart language #861

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rafaeltab
Copy link

Hey, I wanted to have support for the dart language, so I added it. Please let me know if I missed something.

I added inBlock to the comments.go file because when using a /** comment people often add a * prefix as such:

/*
 * Hey
 * How
 * Are
 * You
 */

This is removed by the inBlock regex.

In the format.go file I did not add this, as it seems that each regex includes the comment in the selection here, so there is no need to remove anything, if I am mistaken please let me know.

Important

Dart actually uses markdown inside their comments, I was not sure how to make it recognize it as such. Comments are only interpreted as normal text.

@jdkato
Copy link
Member

jdkato commented Jul 9, 2024

I've moved away from regex-based comment extraction in favor of using Tree-sitter. You can see examples in the internal/lint/code package.

Dart actually uses markdown inside their comments, I was not sure how to make it recognize it as such. Comments are only interpreted as normal text.

Vale can handle this for all supporting languages.

@rafaeltab
Copy link
Author

Oh awesome! I actually looked at adding dart support before, and found a branch with treesitter, but then I couldn't find it this time. I'll get right on implementing this.

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