summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2023-09-25 19:02:11 +0200
committerLaurenz <laurmaedje@gmail.com>2023-09-25 19:02:11 +0200
commit63b5ced5db24c51ac8450283083c0488241f0bbe (patch)
tree04e78a6c45e1ec69c0e1b99046221c5d849401e4
parent0710d1c118efaca52e5151ece32f758f163086b6 (diff)
Add `Tag::LIST` constant
-rw-r--r--crates/typst/src/ide/highlight.rs25
1 files changed, 25 insertions, 0 deletions
diff --git a/crates/typst/src/ide/highlight.rs b/crates/typst/src/ide/highlight.rs
index ad746754..197223f8 100644
--- a/crates/typst/src/ide/highlight.rs
+++ b/crates/typst/src/ide/highlight.rs
@@ -48,6 +48,31 @@ pub enum Tag {
}
impl Tag {
+ /// The list of all tags.
+ pub const LIST: &'static [Tag] = &[
+ Self::Comment,
+ Self::Punctuation,
+ Self::Escape,
+ Self::Strong,
+ Self::Emph,
+ Self::Link,
+ Self::Raw,
+ Self::MathDelimiter,
+ Self::MathOperator,
+ Self::Heading,
+ Self::ListMarker,
+ Self::ListTerm,
+ Self::Label,
+ Self::Ref,
+ Self::Keyword,
+ Self::Operator,
+ Self::Number,
+ Self::String,
+ Self::Function,
+ Self::Interpolated,
+ Self::Error,
+ ];
+
/// Return the recommended TextMate grammar scope for the given highlighting
/// tag.
pub fn tm_scope(&self) -> &'static str {