Skip to content

Commit 69962a0

Browse files
authored
Add indentTab settings (#75)
* feat: add indentTab settings * chore: add changeset
1 parent 84cbc75 commit 69962a0

File tree

6 files changed

+25
-2
lines changed

6 files changed

+25
-2
lines changed

.changeset/soft-dolphins-cheat.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"uroborosql-fmt": minor
3+
---
4+
5+
Add indentTab settings

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ You can enable format on save for SQL by having the following values in your set
5454
"remove_redundant_nest": true,
5555
"complement_sql_id": true,
5656
"convert_double_colon_cast": false,
57-
"unify_not_equal": true
57+
"unify_not_equal": true,
58+
"indent_tab": true
5859
}
5960
```
6061

@@ -78,6 +79,7 @@ If there is no configuration file, the default values are used.
7879
| [`complement_sql_id`](https://github.com/future-architect/uroborosql-fmt/blob/main/docs/options/complement_sql_id.md) | bool | Complement [SQL ID](https://palette-doc.rtfa.as/coding-standards/forSQL/SQL%E3%82%B3%E3%83%BC%E3%83%87%E3%82%A3%E3%83%B3%E3%82%B0%E8%A6%8F%E7%B4%84%EF%BC%88uroboroSQL%EF%BC%89.html#sql-%E8%AD%98%E5%88%A5%E5%AD%90). | false |
7980
| [`convert_double_colon_cast`](https://github.com/future-architect/uroborosql-fmt/blob/main/docs/options/convert_double_colon_cast.md) | bool | Convert casts by `X::type` to the form `CAST(X AS type)`. | true |
8081
| [`unify_not_equal`](https://github.com/future-architect/uroborosql-fmt/blob/main/docs/options/unify_not_equal.md) | bool | Convert comparison operator `<>` to `!=` | true |
82+
| [`indent_tab`](https://github.com/future-architect/uroborosql-fmt/blob/main/docs/options/indent_tab.md) | bool | Switch the indentation style between tabs and spaces. | true |
8183

8284
## Available Commands
8385

client/src/command.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ const vsCodeConfigurationsObject = {
2828
complementSqlId: null,
2929
convertDoubleColonCast: null,
3030
unifyNotEqual: null,
31+
indentTab: null,
3132
} satisfies ConfigurationRecord;
3233

3334
type ConfigurationRecord = {
@@ -46,6 +47,7 @@ type ConfigurationRecord = {
4647
complementSqlId: boolean | null | undefined;
4748
convertDoubleColonCast: boolean | null | undefined;
4849
unifyNotEqual: boolean | null | undefined;
50+
indentTab: boolean | null | undefined;
4951
};
5052

5153
// WorkspaceConfigurationを受け取り、フォーマッタで利用する設定のみのRecordにして返す

package.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,19 @@
226226
],
227227
"default": null,
228228
"markdownDescription": "Convert comparison operator `<>` to `!=`. If this value is null, uroborosql-fmt refers the configuration file or uses the default value."
229+
},
230+
"uroborosql-fmt.indentTab": {
231+
"type": [
232+
"boolean",
233+
"null"
234+
],
235+
"enum": [
236+
true,
237+
false,
238+
null
239+
],
240+
"default": null,
241+
"markdownDescription": "Switch the indentation style between tabs and spaces. If this value is null, uroborosql-fmt refers the configuration file or uses the default value."
229242
}
230243
}
231244
}

server/package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

server/src/server.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ type ConfigurationSettings = {
104104
complementSqlId: boolean | null | undefined;
105105
convertDoubleColonCast: boolean | null | undefined;
106106
unifyNotEqual: boolean | null | undefined;
107+
indentTab: boolean | null | undefined;
107108
};
108109

109110
function getSettings(resource: string): Thenable<ConfigurationSettings> {

0 commit comments

Comments
 (0)