コード例 #1
0
 public void readAttributes(@NotNull Element childNode) {
   for (Element e : childNode.getChildren(OPTION_ELEMENT)) {
     TextAttributesKey name = TextAttributesKey.find(e.getAttributeValue(NAME_ATTR));
     Element valueElement = e.getChild(VALUE_ELEMENT);
     TextAttributes attr =
         valueElement != null ? new TextAttributes(valueElement) : new TextAttributes();
     myAttributesMap.put(name, attr);
     migrateErrorStripeColorFrom14(name, attr);
   }
 }
コード例 #2
0
  @Nullable
  public Map<String, TextAttributesKey> getAdditionalHighlightingTagToDescriptorMap() {
    final Map<String, TextAttributesKey> map = new HashMap<String, TextAttributesKey>();
    map.put("string", BashSyntaxHighlighter.STRING);
    map.put("heredoc", BashSyntaxHighlighter.HERE_DOC);
    map.put("heredocStart", BashSyntaxHighlighter.HERE_DOC_START);
    map.put("heredocEnd", BashSyntaxHighlighter.HERE_DOC_END);
    map.put("backquote", BashSyntaxHighlighter.BACKQUOTE);
    map.put("internalCmd", BashSyntaxHighlighter.INTERNAL_COMMAND);
    map.put("externalCmd", BashSyntaxHighlighter.EXTERNAL_COMMAND);
    map.put("subshellCmd", BashSyntaxHighlighter.SUBSHELL_COMMAND);
    map.put("functionCall", BashSyntaxHighlighter.FUNCTION_CALL);
    map.put("varDef", BashSyntaxHighlighter.VAR_DEF);
    map.put("internalVar", BashSyntaxHighlighter.VAR_USE_BUILTIN);
    map.put("composedVar", BashSyntaxHighlighter.VAR_USE_COMPOSED);

    // we need this to be able to insert << in the text
    // (relies on the current implementation of JetBrain's HighlightsExtractor class)
    map.put("dummy", TextAttributesKey.find("dummy"));
    return map;
  }