PedramNavid / dbtpal

Neovim plugin for dbt
93 stars 8 forks source link

dbt.vim overrides default sql.vim syntax highlighting #28

Open Xemptuous opened 2 months ago

Xemptuous commented 2 months ago

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.

PedramNavid commented 2 months ago

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

Xemptuous commented 2 months ago

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.

PedramNavid commented 2 months ago

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?
Xemptuous commented 2 months ago

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

MinhTriet-TO commented 3 weeks ago

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 https://github.com/PedramNavid/dbtpal/commit/0950ceb88ae898a23f78a4d12fbeeee4cb5dad5e Do you intend to follow this issue and fix it ? Thanks in advance :smile: