User code snippets I had set up on a previous version of the mssql extension that contained tab characters in the body strings no longer work, and when viewing the sql.json file for the snippets, I get a red squiggly error indicator on the first body string that contains a tab character. Removing the tab from that string will cause the red squiggly to show up on the next body string with a tab.
Steps to Reproduce:
Open the sql.json file for SQL user snippets.
Add the following, using tab characters for the indentation within the strings:
"Query information schema": {
"prefix": "INFO",
"body": [
"SELECT",
" *",
"FROM",
" INFORMATION_SCHEMA.COLUMNS",
"",
" INNER JOIN INFORMATION_SCHEMA.TABLES",
" ON INFORMATION_SCHEMA.COLUMNS.TABLE_NAME = INFORMATION_SCHEMA.TABLES.TABLE_NAME",
" AND INFORMATION_SCHEMA.TABLES.TABLE_TYPE <> 'VIEW'",
"WHERE",
" INFORMATION_SCHEMA.COLUMNS.COLUMN_NAME = '$0'",
" --INFORMATION_SCHEMA.COLUMNS.TABLE_NAME = ''",
";"
],
"description": "Query on information schema for table/column names."
}
@kkwillmert I believe this is an issue in the VSCode snippet support. Taking a quick search over their issues, it appears that you should use \t instead of the tab character to have this handled correctly. This will also ensure users tabs vs. spaces preferences are respected. I'd like to close this as external if you have no objections?
No objections at all, and thanks for researching and passing along this
info! I had assumed it was an mssql issue since I encountered it
immediately after I updated mssql, but a few days after I last updated
VSCode. Probably I just hadn't used that particular snippet since
installing the VSCode update.
For the record, I love the mssql extension, it has entirely replaced my use
of SSMS for my day-to-day quick queries :-)
Thanks again!
-Kris
On Tue, May 16, 2017 at 7:24 PM, Kevin Cunnane notifications@github.com
wrote:
@kkwillmert https://github.com/kkwillmert I believe this is an issue in
the VSCode snippet support. Taking a quick search over their issues, it
appears that you should use t instead of the tab character to have this
handled correctly. This will also ensure users tabs vs. spaces preferences
are respected. I'd like to close this as external if you have no objections?—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/Microsoft/vscode-mssql/issues/874#issuecomment-301942522,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AZfA19j4Z0lG5yQnH8e29IUaP1obT8g6ks5r6jBBgaJpZM4NZQMv
.
Glad you're a happy user! Closing this out.
Most helpful comment
@kkwillmert I believe this is an issue in the VSCode snippet support. Taking a quick search over their issues, it appears that you should use
\tinstead of the tab character to have this handled correctly. This will also ensure users tabs vs. spaces preferences are respected. I'd like to close this as external if you have no objections?