-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpackage.json
More file actions
199 lines (199 loc) · 7.2 KB
/
Copy pathpackage.json
File metadata and controls
199 lines (199 loc) · 7.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
{
"name": "sql-format-and-highlight",
"displayName": "SQL Format and Highlight",
"description": "SQL syntax highlighting and formatting for tagged template literals marked with --sql",
"version": "0.2.0",
"license": "MIT",
"publisher": "andrelopes-code",
"author": {
"name": "André Lopes",
"email": "andrelopes.code@gmail.com"
},
"repository": {
"type": "git",
"url": "https://github.com/andrelopes-code/sql-format-and-highlight.git"
},
"bugs": {
"url": "https://github.com/andrelopes-code/sql-format-and-highlight/issues"
},
"homepage": "https://github.com/andrelopes-code/sql-format-and-highlight#readme",
"keywords": [
"sql",
"formatter",
"syntax",
"highlight",
"template literal",
"tagged template",
"postgresql",
"mysql",
"sqlite",
"transactsql",
"plsql",
"bigquery",
"mariadb"
],
"engines": {
"vscode": "^1.75.0"
},
"categories": [
"Formatters",
"Programming Languages"
],
"activationEvents": [
"onLanguage:javascript",
"onLanguage:typescript",
"onLanguage:javascriptreact",
"onLanguage:typescriptreact"
],
"main": "./out/extension.js",
"contributes": {
"commands": [
{
"command": "sqlFormatAndHighlight.formatSqlStrings",
"title": "SQL Format: Format SQL strings in current file"
}
],
"configuration": {
"title": "SQL Format and Highlight",
"properties": {
"sqlFormatAndHighlight.formatOnSave": {
"type": "boolean",
"default": false,
"markdownDescription": "Automatically format SQL strings when saving JS/TS files.\n\n**Prefer the native VS Code mechanism**: set `#editor.formatOnSave#` to `true` and `#editor.defaultFormatter#` (per language) to this extension. Use this setting only when you keep another formatter (e.g. Prettier) as the default and still want SQL strings formatted on save."
},
"sqlFormatAndHighlight.dialect": {
"type": "string",
"default": "sql",
"enum": ["sql", "postgresql", "mysql", "sqlite", "bigquery", "mariadb", "transactsql", "plsql"],
"description": "SQL dialect to use for formatting."
},
"sqlFormatAndHighlight.keywordCase": {
"type": "string",
"default": "upper",
"enum": ["upper", "lower", "preserve"],
"description": "How to format SQL keywords."
},
"sqlFormatAndHighlight.functionCase": {
"type": "string",
"default": "preserve",
"enum": ["upper", "lower", "preserve"],
"description": "How to format SQL function names (COUNT, MAX, etc)."
},
"sqlFormatAndHighlight.identifierCase": {
"type": "string",
"default": "preserve",
"enum": ["upper", "lower", "preserve"],
"description": "How to format identifiers (table names, column names, aliases)."
},
"sqlFormatAndHighlight.dataTypeCase": {
"type": "string",
"default": "preserve",
"enum": ["upper", "lower", "preserve"],
"description": "How to format data types (INT, VARCHAR, etc) in CREATE/ALTER statements."
},
"sqlFormatAndHighlight.indentStyle": {
"type": "string",
"default": "standard",
"enum": ["standard", "tabularLeft", "tabularRight"],
"description": "SQL indentation style."
},
"sqlFormatAndHighlight.tabWidth": {
"type": "number",
"default": 4,
"minimum": 1,
"maximum": 16,
"description": "Number of spaces per indentation level in formatted SQL."
},
"sqlFormatAndHighlight.useTabs": {
"type": "boolean",
"default": false,
"description": "Indent with tab characters instead of spaces."
},
"sqlFormatAndHighlight.expressionWidth": {
"type": "number",
"default": 50,
"minimum": 0,
"description": "Maximum line width before parenthesized expressions wrap across multiple lines."
},
"sqlFormatAndHighlight.linesBetweenQueries": {
"type": "number",
"default": 1,
"minimum": 0,
"description": "Number of blank lines between consecutive SQL statements separated by ';'."
},
"sqlFormatAndHighlight.logicalOperatorNewline": {
"type": "string",
"default": "before",
"enum": ["before", "after"],
"description": "Place AND/OR before or after the line break."
},
"sqlFormatAndHighlight.newlineBeforeSemicolon": {
"type": "boolean",
"default": false,
"description": "Place the closing semicolon of each query on its own line."
},
"sqlFormatAndHighlight.denseOperators": {
"type": "boolean",
"default": false,
"description": "Remove spaces around operators (e.g. id=1 instead of id = 1)."
},
"sqlFormatAndHighlight.paramTypes": {
"type": "array",
"items": { "type": "string", "enum": [":", "@", "$"] },
"default": [":"],
"description": "Named parameter prefixes to recognize (e.g. [\":\"] for :param, [\"@\"] for @param). Prevents sql-formatter from failing on parameterized queries."
},
"sqlFormatAndHighlight.databases": {
"type": "object",
"default": {},
"markdownDescription": "Map database aliases referenced by `--sql@<alias>` markers to a specific SQL dialect. When a template literal starts with `--sql@rm`, this extension will look up `databases.rm` and use that dialect for that block, ignoring the global `#sqlFormatAndHighlight.dialect#`. Unmapped aliases silently fall back to the global dialect.\n\nExample:\n```json\n\"sqlFormatAndHighlight.databases\": {\n \"rm\": \"transactsql\",\n \"pesagem\": \"postgresql\"\n}\n```",
"additionalProperties": {
"type": "string",
"enum": ["sql", "postgresql", "mysql", "sqlite", "bigquery", "mariadb", "transactsql", "plsql"]
}
}
}
},
"grammars": [
{
"scopeName": "inline.sql-tagged-template",
"path": "./syntaxes/sql-injection.tmLanguage.json",
"injectTo": [
"source.js",
"source.jsx",
"source.ts",
"source.tsx"
],
"embeddedLanguages": {
"meta.embedded.block.sql": "sql"
}
}
]
},
"scripts": {
"vscode:prepublish": "npm run compile",
"compile": "tsc -p ./",
"watch": "tsc -watch -p ./",
"pretest": "npm run compile && npm run lint",
"lint": "eslint src",
"test": "vscode-test",
"test:unit": "tsc -p ./ && mocha --require source-map-support/register --config .mocharc.unit.yml",
"vscode:package": "vsce package"
},
"devDependencies": {
"@types/mocha": "^10.0.10",
"@types/node": "22.x",
"@types/source-map-support": "^0.5.10",
"@types/vscode": "^1.75.0",
"@vscode/test-cli": "^0.0.12",
"@vscode/test-electron": "^2.5.2",
"@vscode/vsce": "^3.7.1",
"eslint": "^9.39.3",
"source-map-support": "^0.5.21",
"typescript": "^5.9.3",
"typescript-eslint": "^8.56.1"
},
"dependencies": {
"sql-formatter": "^15.7.3"
}
}