• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Camelcade / Perl5-IDEA / #525521879

11 Jul 2026 07:47AM UTC coverage: 76.024% (-0.02%) from 76.045%
#525521879

push

github

hurricup
Added explicit waiting for debug process to finish

14723 of 22542 branches covered (65.31%)

Branch coverage included in aggregate %.

31082 of 37709 relevant lines covered (82.43%)

0.82 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

80.95
/tt2/common/src/main/java/com/perl5/lang/tt2/idea/highlighting/TemplateToolkitSyntaxHighlighter.java
1
/*
2
 * Copyright 2015-2025 Alexandr Evstigneev
3
 *
4
 * Licensed under the Apache License, Version 2.0 (the "License");
5
 * you may not use this file except in compliance with the License.
6
 * You may obtain a copy of the License at
7
 *
8
 * http://www.apache.org/licenses/LICENSE-2.0
9
 *
10
 * Unless required by applicable law or agreed to in writing, software
11
 * distributed under the License is distributed on an "AS IS" BASIS,
12
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 * See the License for the specific language governing permissions and
14
 * limitations under the License.
15
 */
16

17
package com.perl5.lang.tt2.idea.highlighting;
18

19
import com.intellij.lexer.Lexer;
20
import com.intellij.openapi.editor.colors.TextAttributesKey;
21
import com.intellij.openapi.fileTypes.SyntaxHighlighterBase;
22
import com.intellij.openapi.project.Project;
23
import com.intellij.psi.tree.IElementType;
24
import com.intellij.psi.tree.TokenSet;
25
import com.perl5.lang.perl.idea.highlighter.PerlSyntaxHighlighter;
26
import com.perl5.lang.tt2.lexer.TemplateToolkitLexerAdapter;
27
import org.jetbrains.annotations.NotNull;
28

29
import static com.intellij.openapi.editor.colors.TextAttributesKey.createTextAttributesKey;
30
import static com.perl5.lang.tt2.parser.TemplateToolkitElementTypesGenerated.*;
31

32

33
public class TemplateToolkitSyntaxHighlighter extends SyntaxHighlighterBase {
34
  public static final TextAttributesKey TT2_NUMBER_KEY = createTextAttributesKey("PERL_TT2_NUMBER", PerlSyntaxHighlighter.PERL_NUMBER);
1✔
35
  public static final TextAttributesKey TT2_MARKER_KEY = createTextAttributesKey("PERL_TT2_MARKER", PerlSyntaxHighlighter.EMBED_MARKER_KEY);
1✔
36
  public static final TextAttributesKey TT2_COMMENT_KEY = createTextAttributesKey("PERL_TT2_COMMENT", PerlSyntaxHighlighter.PERL_COMMENT);
1✔
37
  public static final TextAttributesKey TT2_IDENTIFIER_KEY = createTextAttributesKey("PERL_TT2_IDENTIFIER", PerlSyntaxHighlighter.PERL_SUB);
1✔
38
  public static final TextAttributesKey TT2_KEYWORD_KEY = createTextAttributesKey("PERL_TT2_KEYWORD", PerlSyntaxHighlighter.PERL_KEYWORD);
1✔
39
  public static final TextAttributesKey TT2_OPERATOR_KEY =
1✔
40
    createTextAttributesKey("PERL_TT2_OPERATOR", PerlSyntaxHighlighter.PERL_OPERATOR);
1✔
41
  public static final TextAttributesKey TT2_SQ_STRING_KEY =
1✔
42
    createTextAttributesKey("PERL_TT2_SQ_STRING", PerlSyntaxHighlighter.PERL_SQ_STRING);
1✔
43
  public static final TextAttributesKey TT2_DQ_STRING_KEY =
1✔
44
    createTextAttributesKey("PERL_TT2_DQ_STRING", PerlSyntaxHighlighter.PERL_DQ_STRING);
1✔
45
  private static final TextAttributesKey[] TT2_NUMBER_KEYS = new TextAttributesKey[]{TT2_NUMBER_KEY};
1✔
46
  private static final TextAttributesKey[] TT2_MARKER_KEYS = new TextAttributesKey[]{TT2_MARKER_KEY};
1✔
47
  private static final TextAttributesKey[] TT2_COMMENT_KEYS = new TextAttributesKey[]{TT2_COMMENT_KEY};
1✔
48
  private final Project myProject;
49
  private final TokenSet myMarkers = TokenSet.create(
1✔
50
    TT2_OPEN_TAG,
51
    TT2_CLOSE_TAG,
52
    TT2_OUTLINE_TAG
53
  );
54

55
  public TemplateToolkitSyntaxHighlighter(Project project) {
1✔
56
    myProject = project;
1✔
57
  }
1✔
58

59
  @Override
60
  public @NotNull Lexer getHighlightingLexer() {
61
    return new TemplateToolkitHighlightingLexer(new TemplateToolkitLexerAdapter(myProject));
1✔
62
  }
63

64
  @Override
65
  public TextAttributesKey @NotNull [] getTokenHighlights(IElementType tokenType) {
66
    if (myMarkers.contains(tokenType)) {
1✔
67
      return TT2_MARKER_KEYS;
1!
68
    }
69
    else if (tokenType == TT2_NUMBER || tokenType == TT2_NUMBER_SIMPLE) {
1!
70
      return TT2_NUMBER_KEYS;
×
71
    }
72
    else if (tokenType == LINE_COMMENT) {
1✔
73
      return TT2_COMMENT_KEYS;
1!
74
    }
75
    return TextAttributesKey.EMPTY_ARRAY;
1!
76
  }
77
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc