Scaffold project

This commit is contained in:
oaklake89 committed 2026-11-20 15:35:31 +00:00
1 parent 9fb45e60e0
commit 4ced331813
10 files changed
+2163

No files matched your search

+17
View File
@@ -0,0 +1,17 @@
// A launch configuration that launches the extension inside a new window
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
{
"version": "0.2.0",
"configurations": [
{
"name": "Extension",
"type": "extensionHost",
"request": "launch",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}"
]
}
]
}
+5
View File
@@ -0,0 +1,5 @@
.devcontainer/**
.vscode/**
.vscode-test/**
.gitignore
vsc-extension-quickstart.md
+9
View File
@@ -0,0 +1,9 @@
# Change Log
All notable changes to the "vsc-t-sql-strings" extension will be documented in this file.
Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file.
## [Unreleased]
- Initial release
+21
View File
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2025 Gunnar Johansson
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
+39
View File
@@ -0,0 +1,39 @@
# T-SQL Strings
Syntax highlighting for dynamic T-SQL inside string literals in VS Code.
## Features
- **Dynamic SQL highlighting** — Highlights common T-SQL keywords, functions, data types, operators, and variables inside string literals.
- **Multiline SQL support** — Recognizes dynamic SQL statements spanning multiple lines.
- **Escaped string handling** — Handles doubled single quotes (`''`) commonly used in dynamic T-SQL.
- **Variable highlighting** — Recognizes local variables (`@variable`) and system variables (`@@ROWCOUNT`).
- **String concatenation** — Highlights recognizable SQL syntax in individual string fragments, including concatenated expressions.
- **Standard SQL compatibility** — Preserves highlighting for ordinary SQL statements and non-SQL string literals.
- **Theme integration** — Uses standard TextMate scopes to integrate with VS Code color themes.
## Requirements
No additional runtime dependencies are required.
## Extension Settings
This extension does not contribute any configurable settings.
Syntax highlighting is applied automatically to supported SQL documents.
## Limitations
T-SQL Strings uses TextMate grammars and regular expressions rather than a full T-SQL parser. Syntax highlighting is therefore based on recognizable patterns rather than a complete understanding of the SQL code.
- **SQL detection** — Dynamic SQL strings that do not match recognized patterns may retain standard string highlighting.
- **Complex expressions** — Deeply nested string literals, unusual quoting patterns, and advanced dynamic SQL constructions may not always be highlighted correctly.
- **Syntax coverage** — Less common T-SQL constructs may not receive specialized highlighting.
The extension provides syntax highlighting only. It does not reconstruct dynamically generated queries, validate SQL syntax, execute statements, or provide IntelliSense.
## Release Notes
### 1.0.0
Initial release of T-SQL Strings.
View File
Whitespace-only changes.
+1884
View File
File diff suppressed because it is too large. Load diff
+52
View File
@@ -0,0 +1,52 @@
{
"name": "vsc-t-sql-strings",
"displayName": "T-SQL Strings",
"description": "Highlight quoted Transact-SQL strings.",
"license": "MIT",
"version": "1.0.0",
"publisher": "oaklake89",
"repository": {
"type": "git",
"url": "https://git.kvarnarp.se/vscode/vsc-t-sql-strings.git"
},
"engines": {
"vscode": "^1.146.0"
},
"categories": [
"Programming Languages"
],
"contributes": {
"grammars": [
{
"scopeName": "source.sql.embedded.strings",
"path": "./syntaxes/sql.tmLanguage.json",
"injectTo": [
"source.sql",
"source.tsql",
"source.transactsql"
],
"embeddedLanguages": {
"meta.embedded.inline.sql": "sql"
}
},
{
"scopeName": "source.sql.variables",
"path": "./syntaxes/sql-variables.tmLanguage.json",
"injectTo": [
"source.sql",
"source.tsql",
"source.transactsql"
],
"embeddedLanguages": {
"meta.embedded.inline.sql": "sql"
}
}
]
},
"devDependencies": {
"@vscode/vsce": "4.1.2-0"
},
"allowScripts": {
"@vscode/vsce-sign@2.1.1": true
}
}
+14
View File
@@ -0,0 +1,14 @@
{
"scopeName": "source.sql.variables",
"injectionSelector": "L:source.sql - string - comment, L:source.tsql - string - comment, L:source.transactsql - string - comment",
"patterns": [
{
"name": "support.variable.system.tsql",
"match": "@@[A-Za-z_][A-Za-z0-9_]*"
},
{
"name": "variable.other.parameter.tsql",
"match": "@(?!@)[A-Za-z_][A-Za-z0-9_]*"
}
]
}
+122
View File
@@ -0,0 +1,122 @@
{
"scopeName": "source.sql.embedded.strings",
"injectionSelector": "L:source.sql - string - comment - meta.dynamic-sql.literal.sql - meta.embedded.inline.sql, L:source.tsql - string - comment - meta.dynamic-sql.literal.sql - meta.embedded.inline.sql, L:source.transactsql - string - comment - meta.dynamic-sql.literal.sql - meta.embedded.inline.sql",
"patterns": [
{
"name": "meta.dynamic-sql.literal.sql",
"begin": "(?i:(?<![A-Za-z0-9_])(N)?(')(?:(?=[ \\t]*;?[ \\t]*(?:SELECT|WITH|INSERT|UPDATE|DELETE|MERGE|EXEC(?:UTE)?|CREATE|ALTER|DROP|DECLARE|SET|USE|FROM|WHERE|JOIN|IF|HAVING|UNION|GROUP[ \\t]+BY|ORDER[ \\t]+BY)\\b)|(?=[ \\t]*;?[ \\t]*$)))",
"beginCaptures": {
"1": {
"name": "storage.type.string.sql"
},
"2": {
"name": "punctuation.definition.string.begin.sql"
}
},
"end": "'",
"applyEndPatternLast": true,
"endCaptures": {
"0": {
"name": "punctuation.definition.string.end.sql"
}
},
"contentName": "meta.embedded.inline.sql",
"patterns": [
{
"name": "meta.bracketed-identifier.sql",
"match": "(\\[)(?:[^\\]]|\\]\\])*(\\])",
"captures": {
"1": {
"name": "punctuation.definition.identifier.begin.sql"
},
"2": {
"name": "punctuation.definition.identifier.end.sql"
}
}
},
{
"name": "string.quoted.single.sql",
"match": "''(?:[^']|'')*?''"
},
{
"name": "constant.character.escape.sql",
"match": "''"
},
{
"name": "comment.block.sql",
"begin": "/\\*",
"end": "\\*/"
},
{
"name": "comment.line.double-dash.sql",
"match": "--[^'\\r\\n]*"
},
{
"name": "support.variable.system.sql",
"match": "@@[A-Za-z_][A-Za-z0-9_]*"
},
{
"name": "variable.other.parameter.sql",
"match": "@(?!@)[A-Za-z_][A-Za-z0-9_]*"
},
{
"name": "support.function.sql",
"match": "(?i:\\b(?:COUNT|SUM|AVG|MIN|MAX|COALESCE|ISNULL|NULLIF|CAST|CONVERT|TRY_CONVERT|ROW_NUMBER|GETDATE|DATEADD|DATEDIFF|LEN|SUBSTRING|CHARINDEX|PATINDEX|OBJECT_ID|LTRIM|RTRIM|TRIM|LEFT|RIGHT|CONCAT|QUOTENAME|REPLACE|LOWER|UPPER|NEWID|STRING_AGG|STRING_SPLIT)\\b)(?=[ \\t]*\\()"
},
{
"name": "support.function.sql",
"match": "(?i:\\b(?:COUNT|SUM|AVG|MIN|MAX|COALESCE|ISNULL|NULLIF|CAST|CONVERT|TRY_CONVERT|ROW_NUMBER|GETDATE|DATEADD|DATEDIFF|LEN|SUBSTRING|CHARINDEX|PATINDEX|OBJECT_ID|LTRIM|RTRIM|TRIM|CONCAT|QUOTENAME|REPLACE|LOWER|UPPER|NEWID|STRING_AGG|STRING_SPLIT)\\b)(?=[ \\t]*$)"
},
{
"name": "keyword.other.DML.sql",
"match": "(?i:\\b(?:SELECT|INSERT|INTO|UPDATE|DELETE|MERGE|FROM|WHERE|JOIN|INNER|LEFT|RIGHT|FULL|OUTER|CROSS|ON|GROUP[ \\t]+BY|ORDER[ \\t]+BY|HAVING|UNION(?:[ \\t]+ALL)?|TOP|DISTINCT|ALL|AS|AND|OR|NOT|IN|IS|LIKE|BETWEEN|EXISTS|OFFSET|FETCH|CASE|WHEN|THEN|ELSE|END|SET|VALUES|OUTPUT)\\b)"
},
{
"name": "keyword.other.sql",
"match": "(?i:\\b(?:USE|WITH|DECLARE|BEGIN|COMMIT|ROLLBACK|EXEC(?:UTE)?|CREATE|ALTER|DROP|TRUNCATE|TABLE|VIEW|PROCEDURE|FUNCTION|IF|WHILE|RETURN|TRY|CATCH|THROW|PRINT|GO|OPTION|RECOMPILE|OVER|PARTITION|BY|INDEX|CLUSTERED|NONCLUSTERED|ASC|DESC)\\b)"
},
{
"name": "storage.type.sql",
"match": "(?i:\\b(?:SYSNAME|NVARCHAR|VARCHAR|NCHAR|CHAR|INT|BIGINT|SMALLINT|TINYINT|BIT|DECIMAL|NUMERIC|FLOAT|DATE|DATETIME|DATETIME2|DATETIMEOFFSET|UNIQUEIDENTIFIER|VARBINARY|BINARY|XML)\\b)"
},
{
"name": "constant.language.sql",
"match": "(?i:\\b(?:NULL|TRUE|FALSE|DEFAULT)\\b)"
},
{
"name": "constant.numeric.sql",
"match": "\\b[0-9]+(?:\\.[0-9]+)?\\b"
},
{
"name": "keyword.operator.sql",
"match": "<>|!=|<=|>=|[=<>+*/%-]"
}
]
},
{
"name": "string.quoted.single.sql",
"begin": "(?i:(?<![A-Za-z0-9_])(N))?(')",
"beginCaptures": {
"1": {
"name": "storage.type.string.sql"
},
"2": {
"name": "punctuation.definition.string.begin.sql"
}
},
"end": "'(?!')",
"endCaptures": {
"0": {
"name": "punctuation.definition.string.end.sql"
}
},
"applyEndPatternLast": true,
"patterns": [
{
"name": "constant.character.escape.sql",
"match": "''"
}
]
}
]
}