rikvdkleij / intellij-haskell

IntelliJ plugin for Haskell
https://rikvdkleij.github.io/intellij-haskell/
Apache License 2.0
1.31k stars 96 forks source link

Support highlighting for fmt quasiquotes from PyF #652

Open declension opened 3 years ago

declension commented 3 years ago

Hi!

We've switched to using the excellent PyF, but one drawback is the things that were raw strings (now quasiquotes) are not highlighted at at all it seems (not even as a string, nor is the fmt qq specifier itself) in the IDE.

I'm not sure if there is a language to inject here (it's similar to a few templating languages I guess) (re: #445)

Here's an example test case

import PyF (fmt)

spec = 
  it "fmt QQ should work" $ do
      let a = 2 :: Double
          b = 3
          c = a / b
          string = [fmt| Look! {a} / {b} == {c:.3}|] :: String
      string `shouldBe` "Look! 2.0 / 3.0 == 0.667"
rikvdkleij commented 2 years ago

Thanks for reporting!

For me [fmt| Look! {a} / {b} == {c:.3}|] is highlighted in yellow but it contains a parser error.

rikvdkleij commented 2 years ago

Hmm, after installing PyF and enabling {-# LANGUAGE QuasiQuotes #-} it just works in beta87.