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 Dart highlighting support #229

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Add Dart highlighting support #229

wants to merge 4 commits into from

Conversation

joshdick
Copy link
Owner

@joshdick joshdick commented Jul 7, 2020

Implements #226.

@l0nax
Copy link

l0nax commented Jul 9, 2020

The colors do look like expected 👍

Copy link
Owner Author

@joshdick joshdick left a comment

Choose a reason for hiding this comment

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

@Akin909 @l0nax After correlating with https://github.com/dart-lang/dart-vim-plugin/blob/master/syntax/dart.vim, onedark.vim actually has default highlighting for basically all groups in this PR, so I think the PR is almost entirely redundant.

All highlight links also appear to be redundant, since they're already all defined in https://github.com/dart-lang/dart-vim-plugin/blob/master/syntax/dart.vim.

@@ -297,6 +297,17 @@ call s:h("cssSelectorOp", { "fg": s:purple })
call s:h("cssSelectorOp2", { "fg": s:purple })
call s:h("cssTagName", { "fg": s:red })

" Dart
call s:h("dartTypeDef", { "fg": s:red })
Copy link
Owner Author

Choose a reason for hiding this comment

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

dartTypeDef points to Typedef which already has highlighting in onedark.vim

@@ -297,6 +297,17 @@ call s:h("cssSelectorOp", { "fg": s:purple })
call s:h("cssSelectorOp2", { "fg": s:purple })
call s:h("cssTagName", { "fg": s:red })

" Dart
call s:h("dartTypeDef", { "fg": s:red })
call s:h("dartClassDecl", { "fg": s:red })
Copy link
Owner Author

Choose a reason for hiding this comment

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

dartClassDecl points to dartStorageClass which points to StorageClass, which already has highlighting in onedark.vim, so the first two are redundant

call s:h("dartInterpolation", { "fg": s:blue })
highlight link dartLibrary Include
call s:h("dartSdkClass", { "fg": s:cyan })
call s:h("dartStorageClass", { "fg": s:dark_red })
Copy link
Owner Author

Choose a reason for hiding this comment

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

See dartClassDecl.

" Dart
call s:h("dartTypeDef", { "fg": s:red })
call s:h("dartClassDecl", { "fg": s:red })
call s:h("dartInterpolation", { "fg": s:blue })
Copy link
Owner Author

Choose a reason for hiding this comment

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

dartInterpolation points to PreProc, which already has highlighting in onedark.vim

call s:h("dartClassDecl", { "fg": s:red })
call s:h("dartInterpolation", { "fg": s:blue })
highlight link dartLibrary Include
call s:h("dartSdkClass", { "fg": s:cyan })
Copy link
Owner Author

Choose a reason for hiding this comment

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

dartSdkClass points to dartType which points to Type, which already has highlighting in onedark.vim

call s:h("dartStorageClass", { "fg": s:dark_red })
highlight link dartExceptions Exception
highlight link dartStatement Statement
call s:h("dartConstant", { "fg": s:dark_yellow })
Copy link
Owner Author

Choose a reason for hiding this comment

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

dartConstant points to Constant, which already has highlighting in onedark.vim

@l0nax
Copy link

l0nax commented Jul 22, 2020

Then why does the default syntax highlighting not work for dart files? (Everything is yellow)

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