vscode-dbt-power-user icon indicating copy to clipboard operation
vscode-dbt-power-user copied to clipboard

VSCode shortcut for multi-line/block comments not parseable

Open Daryl149 opened this issue 1 year ago • 0 comments

Expected behavior

given the above sample model sample_model.sql

select * 
from tbl
where my_filter = 1

When I use the block comment shortcut CTRL+/, I expect it to comment code in SQL format as follows:

/* select * 
from tbl
where my_filter = 1 */

Actual behavior

instead it gets commented in Jinja format as:

{# select * 
from tbl
where my_filter = 1 #}

When I run this, I receive this error:

Missing end of comment tag line 1 {# select *

Steps To Reproduce

Open a dbt project in VSCode, open or create a model, e.g. sample_model.sql, which contains

select * 
from tbl
where my_filter = 1

use the block comment shortcut CTRL+/

Log output/Screenshots

The problem is that for single line comments, the parser accepts both sql comments -- and jinja comments {# #}. For block comments / multiline comments, the parser accepts only sql comments /* */, but not jinja comments.

Operating System

Windows 10

dbt version

  • installed: 1.5.2

dbt Adapter

databricks and spark

dbt Power User version

0.26.0

Are you willing to submit PR?

  • [ ] Yes I am willing to submit a PR!

Daryl149 avatar Dec 06 '23 10:12 Daryl149