clarkyu2016 / sql-beautify

VS Code extension that beautifies SQL(HQL).
MIT License
60 stars 21 forks source link

case 语句 bug #42

Open Mr-ZeLong opened 2 years ago

Mr-ZeLong commented 2 years ago

如果对下面的语句进行格式化,会发现 case 后面出问题 select 1,2,3, case -- case 语句注释 when name='a' then 123 -- c1 when name = 'b' then 132 -- c2 when name = 'c' then 25 --c3 end as alias from t1;

clarkyu2016 commented 2 years ago

已知问题,目前无法解决😢

不过可以把注释换个地方写,目前这两种方式是可以识别的 select 1,2,3, -- case 语句注释 case when name='a' then 123 -- c1 when name = 'b' then 132 -- c2 when name = 'c' then 25 --c3 end as alias from t1;

select 1,2,3, case when name='a' then 123 -- c1 when name = 'b' then 132 -- c2 when name = 'c' then 25 --c3 end as alias -- case 语句注释 from t1;

clarkyu2016 commented 1 year ago

0.3.22版本已经修复,但是失去了部分对齐功能,这个后续再更新