From 0b1e9721e5c26f8b344ed2faae9dc98fa65796c5 Mon Sep 17 00:00:00 2001 From: "dmitriy.gorevoy" Date: Sun, 8 Dec 2024 11:09:23 +0100 Subject: [PATCH] Comment annotations (TODO, NOTE, IMPORTANT) added to sublime-synthax. Those can be overriden in color theme to highlight those annotations with colors. --- Odin.sublime-syntax | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/Odin.sublime-syntax b/Odin.sublime-syntax index 6da262b..08b9a16 100644 --- a/Odin.sublime-syntax +++ b/Odin.sublime-syntax @@ -27,27 +27,41 @@ contexts: - match: /\* scope: punctuation.definition.comment.odin push: + - include: comment-annotations - meta_scope: comment.block.odin - match: \*/ scope: punctuation.definition.comment.odin pop: true - include: block-comment - comments: - - include: block-comment + line-comments: - match: // scope: punctuation.definition.comment.odin push: + - include: comment-annotations - meta_scope: comment.line.double-slash.odin - match: \n pop: true - match: "#!" scope: punctuation.definition.comment.odin push: + - include: comment-annotations - meta_scope: comment.line.double-slash.odin - match: \n pop: true + comment-annotations: + - match: (?i)\b(TODO)\b + scope: annotation.todo.odin + - match: (?i)\b(NOTE)\b + scope: annotation.note.odin + - match: (?i)\b(IMPORTANT)\b + scope: annotation.important.odin + + comments: + - include: block-comment + - include: line-comments + keywords: - match: \b(import|foreign|package)\b scope: keyword.control.odin