Skip to content

Conversation

@MorphCodeBot
Copy link
Collaborator

Problem

CMake's multi-line comments (#[[...]]) were not properly supported and were being treated as single-line comments.

Changes

  • Replaced hljs.HASH_COMMENT_MODE with a custom comment mode implementation
  • Added support for CMake's multi-line comment syntax (#[[...]])
  • Implemented proper nesting support for multi-line comments
  • Set higher relevance for multi-line comments to ensure correct precedence

Implementation Details

  • Multi-line comments now correctly match from #[[ to ]]
  • Comments can be nested (e.g., #[[ outer #[[ inner ]] outer ]])
  • Single-line comments (#) continue to work as expected

Testing

Verified that the following syntax is now correctly highlighted:

#[[test
test
test]]

All content between #[[ and ]] is properly recognized as a comment, regardless of line breaks.

Additional ticket processing details

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