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

Fix regex for syntax-highlighting of keywords #1

Closed
wants to merge 1 commit into from
Closed

Fix regex for syntax-highlighting of keywords #1

wants to merge 1 commit into from

Conversation

squidfunk
Copy link

Hi there,

I don't know if it's only for me, but syntax highlighting for Doxygen-style comments doesn't work with C, C++ and other packages, as the regex which matches comments in those packages overrides the regex used by the Doxygen bundle. Therefore I introduced look-aheads and -behinds to detect, whether we're inside a comment.

Brackets with arguments to keywords were'nt matched either, so I extended the regex.

example

Would be glad if this would make it into master!

Best
Martin

@infininight
Copy link
Member

Can you describe how you use this grammar? As a stand alone grammar that only highlights comments it seems not very useful to me as it will never be active without disable other syntax highlighting. Are you including it from another grammar?

@squidfunk
Copy link
Author

I just installed it via the Textmate properties and realized that it wasn't correctly highlighting doxygen-style comments within C or C++ files.

If you look at the grammar you'll realize that the comment.block.doxygen rule actually looks for /** or /*!, but /* is already recognized by the C, C++, PHP, Java etc. packages as a default comment, so /** never gets parsed. Using a positive look-behind it works correctly. You don't have to include it from other packages, it will work straight away, and I think that's the point of it, just like the TODO package.

@infininight
Copy link
Member

The current Doxygen bundle is not injected in the same manner as TODO. Currently to use this grammar it must be selected directly. Even if it was injected or included the order it's included should suffice to activate the rules negating the need for this change.

@infininight infininight closed this Oct 8, 2014
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.

None yet

2 participants