Add Syntax Highlighting/Intellisense inside SQL Strings in C-Sharp/VB Files
The SQL Server Database Tools and SQL Server Management Studio tools are excellent, but it would be super helpful if Visual Studio also did SQL syntax highlighting and intellisense inside of SQL strings in files other than those with .sql extensions. Namely, C-Sharp and VB files.
Doing simple queries with an inline string is an incredibly common pattern, so actually having some intellisense and/or compilation warnings would be great.
This would enable a much more efficient development story for cases where using something like Dapper.net is preferable over a heavier OR/M like EntityFramework.
Dylan Nicholson commented
There is a plug-in that does this, namely SqlSyntaxHighlighting, but the original version and the one on the marketplace is only for VS 2012 and earlier. There's a fork in github that does in fact build a working version for VS 2017, and I've tried it out, seems to work well.
Add the following to the application process
Gold coin bill introduct to twenten usaol. ...
GASESES BUHOMS INKESOMA INOMSA
Have you looked at https://github.com/ErikEJ/TSqlAnalyzer ?
Claude Adrian commented
Not only SQL highlighting but also code lens inside the SSDT project showing you references to the C# file/line where the name of the sproc or table/view was noticed inside a string. They could even add a new type of string literal for sql queries that would be scanned if a SSDT project was found in the solution.
we need sql syntax Highlighting/Intellisense