package org.jetbrains.cabal.highlight;

import com.intellij.lexer.Lexer;
import com.intellij.openapi.editor.colors.TextAttributesKey;
import com.intellij.openapi.fileTypes.SyntaxHighlighterBase;
import com.intellij.psi.tree.IElementType;
import gnu.trove.THashMap;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.cabal.parser.CabalLexer;
import org.jetbrains.cabal.parser.CabalTokelTypes;
import org.jetbrains.haskell.highlight.HaskellHighlighter;

import java.util.Map;

public class CabalHighlighter extends SyntaxHighlighterBase {
  private static final Map<IElementType, TextAttributesKey> keys1;

  @NotNull
  public Lexer getHighlightingLexer() {
    return new CabalLexer();
  }


  static {
    keys1 = new THashMap<IElementType, TextAttributesKey>();

    keys1.put(CabalTokelTypes.STRING, new HaskellHighlighter().getSTRING_LITERAL());
    keys1.put(CabalTokelTypes.END_OF_LINE_COMMENT, new HaskellHighlighter().getCOMMENT_STYLE());
    keys1.put(CabalTokelTypes.COMMENT, new HaskellHighlighter().getCOMMENT_STYLE());


  }

  @NotNull
  public TextAttributesKey[] getTokenHighlights(IElementType tokenType) {
    return pack(keys1.get(tokenType));
  }

}
@@ -806,20 +806,16 @@
 .STRING,
- new
  Haskell
@@ -825,22 +825,17 @@
 hlighter
-().get
+.
 STRING_L
@@ -840,18 +840,16 @@
 _LITERAL
-()
 );%0A    k
@@ -885,36 +885,32 @@
 OF_LINE_COMMENT,
- new
  HaskellHighligh
@@ -904,38 +904,33 @@
 skellHighlighter
-().get
+.
 COMMENT_STYLE())
@@ -926,18 +926,16 @@
 NT_STYLE
-()
 );%0A    k
@@ -967,20 +967,16 @@
 COMMENT,
- new
  Haskell
@@ -990,14 +990,9 @@
 hter
-().get
+.
 COMM
@@ -1000,18 +1000,16 @@
 NT_STYLE
-()
 );%0A%0A%0A  %7D

Fix compilation