sdiehl / haskell-vim-proto

Basic starter config for Vim and Haskell

Home Page:http://www.stephendiehl.com/posts/vim_2016.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

incorrect highlighting for multiply-nested TH splices / quasi-quotes

tdammers opened this issue · comments

Highlighting chokes on code that has multiple nested levels of splices and quasiquotes, like in this example:

mkServer :: String -> String -> [Name] -> ExpQ
mkServer pre post rqNames =
    [e|makeServer
        $(listE
            [ [| impl (undefined :: $(conT rqName)) |]
            | rqName <- rqNames
            ]) |]

Highlighting picks up the beginning of the [e| quote correctly, but then fails to recognize the inner quote ([| impl ...), interpreting its closing bracket as the closing bracket for the outer quote.

Do you know of highlighting script that fixes this?

The current one is an adaption of this base: https://github.com/vim-scripts/haskell.vim/blob/master/syntax/haskell.vim

Unfortunately, no, I've never dived into the wonderful world of vim syntax highlighting definitions, was hoping someone else might feel like looking into it.