Rescue live templates in sql files

I created a live template for creating a stored procedure, and I set the availability in * .sql files. But when I’m in an SQL file, I don’t have the opportunity to use a live template by typing a shortcut to a live template. I know that I need to change some settings in Visual Studio or in Resharper, but I did not find anything. Do you have any idea about this? I am using VS 2013 and Resharper 8. Thanks.

+4
source share
2 answers

ReSharper Live Templates only work in file formats supported by ReSharper, because Live Templates rely on other ReSharper features that languages ​​must understand, such as automatic formatting, name reduction, and auto-import and domain accessibility. In addition, Live Templates are inserted by selecting an item from the ReSharper code completion windows - if there is no code completion, there can be no live templates.

Since ReSharper is not aware of .sql files, you are not getting Live Templates.

-1
source

Custom live templates should work in .sql files.

You did not mention how you install your live template, but here is how I understood it with Visual Studio 2013 and ReSharper 8.2.

sf + TAB select * from $TABLE$ .sql.

  • ReSharper Template Explorer RESHARPER → ...

  • , " " (1-) .

  • "" , "".

  • , .

  • sf.

  • select * from $TABLE$.

  • "".

  • " " "" " ".

  • *.sql

  • .

sf .sql.

, . ReSharper RESHARPER → Options → Keybaord and Menus.

+5

Source: https://habr.com/ru/post/1547558/


All Articles