PedramNavid/dbtpal

dbt.vim overrides default sql.vim syntax highlighting

Closed this issue · 6 comments

the file dbt.vim breaks syntax highlighting (atleast on my setup) unless I comment out either of these two lines:

syn match   dbtJinjaOperator    "{{\|}}\|{%\|%}"
syn cluster dbtJinja           contains=dbtJinjaOperator,dbtJinjaFunction,dbtJinjaString

It looks like 0950ceb caused this issue, because when I revert the syn region dbtJinjaTemplate line to the previous version, it works.

Oof. Syntax is really hard. You can also try setting custom_dbt_syntax_enabled = false

That seems to have helped to an extent (better than before, and having to modify the source file), but I still have most sql keywords not being highlighted anytime there is jinja syntax before them in the file. It's as though it hijacks it and doesn't go back to using the default SQL syntax between jinja blocks.

That seems to have helped to an extent (better than before, and having to modify the source file), but I still have most sql keywords not being highlighted anytime there is jinja syntax before them in the file. It's as though it hijacks it and doesn't go back to using the default SQL syntax between jinja blocks.

Can you try opening up a SQL file with jinja please and let me know the output of this:

:set ft?

Can you try opening up a SQL file with jinja please and let me know the output of this:

:set ft?

it's set to dbt.

Still have this issue, to where using ft=sql makes things much more readable, but then no jinja gets highlighted.

Looks like all dbt stuff is highlighted properly, but as soon as a jinja block happens, almost none of the sql stuff afterwards is highlighted.

image

Hello @PedramNavid, i have the same problem here. I use nvim-treesitter for syntax highlighting and when i install dbtpal, it just messed up the syntax highlighting. Everything worked well until your latest commit 0950ceb
Do you intend to follow this issue and fix it ? Thanks in advance 😄

Hi @MinhTriet-TO and @Xemptuous. I finally had some time to look at this and I believe I fixed it in this commit
I had an empty setup call that would reset your preferences. Hope this helps, sorry for the delay, my notifications are a bit of a mess.