diff --git a/.changeset/soft-dolphins-cheat.md b/.changeset/soft-dolphins-cheat.md new file mode 100644 index 0000000..8a098ed --- /dev/null +++ b/.changeset/soft-dolphins-cheat.md @@ -0,0 +1,5 @@ +--- +"uroborosql-fmt": minor +--- + +Add indentTab settings diff --git a/README.md b/README.md index b28c222..6343b87 100644 --- a/README.md +++ b/README.md @@ -54,7 +54,8 @@ You can enable format on save for SQL by having the following values in your set "remove_redundant_nest": true, "complement_sql_id": true, "convert_double_colon_cast": false, - "unify_not_equal": true + "unify_not_equal": true, + "indent_tab": true } ``` @@ -78,6 +79,7 @@ If there is no configuration file, the default values are used. | [`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 | | [`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 | | [`unify_not_equal`](https://github.com/future-architect/uroborosql-fmt/blob/main/docs/options/unify_not_equal.md) | bool | Convert comparison operator `<>` to `!=` | true | +| [`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 | ## Available Commands diff --git a/client/src/command.ts b/client/src/command.ts index 8c915fb..a7e583b 100644 --- a/client/src/command.ts +++ b/client/src/command.ts @@ -28,6 +28,7 @@ const vsCodeConfigurationsObject = { complementSqlId: null, convertDoubleColonCast: null, unifyNotEqual: null, + indentTab: null, } satisfies ConfigurationRecord; type ConfigurationRecord = { @@ -46,6 +47,7 @@ type ConfigurationRecord = { complementSqlId: boolean | null | undefined; convertDoubleColonCast: boolean | null | undefined; unifyNotEqual: boolean | null | undefined; + indentTab: boolean | null | undefined; }; // WorkspaceConfigurationを受け取り、フォーマッタで利用する設定のみのRecordにして返す diff --git a/package.json b/package.json index 2dc2e98..de17b20 100644 --- a/package.json +++ b/package.json @@ -226,6 +226,19 @@ ], "default": null, "markdownDescription": "Convert comparison operator `<>` to `!=`. If this value is null, uroborosql-fmt refers the configuration file or uses the default value." + }, + "uroborosql-fmt.indentTab": { + "type": [ + "boolean", + "null" + ], + "enum": [ + true, + false, + null + ], + "default": null, + "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." } } } diff --git a/server/package-lock.json b/server/package-lock.json index 9355bf9..3aef99a 100644 --- a/server/package-lock.json +++ b/server/package-lock.json @@ -21,7 +21,7 @@ "node_modules/uroborosql-fmt-napi": { "version": "0.0.0", "resolved": "file:uroborosql-fmt-napi-0.0.0.tgz", - "integrity": "sha512-nx47epBvAP4CZqxVImp4FQUqvz69fkUkmYdhC+TySvWfRRWBh2SwR0xtnEuSufpWRT+mGsuB2GMemlTc7ABvIA==", + "integrity": "sha512-fS7k63YIRbZCqBBMeqZtrhzoauoekI/Fhb0jS7oupxnqKzyXefF89uqiuRy/WYYM773I2YY8BjNAuKSsF8HJ5A==", "license": "BUSL-1.1", "engines": { "node": ">= 10" diff --git a/server/src/server.ts b/server/src/server.ts index 07aa70f..2c6d6af 100644 --- a/server/src/server.ts +++ b/server/src/server.ts @@ -104,6 +104,7 @@ type ConfigurationSettings = { complementSqlId: boolean | null | undefined; convertDoubleColonCast: boolean | null | undefined; unifyNotEqual: boolean | null | undefined; + indentTab: boolean | null | undefined; }; function getSettings(resource: string): Thenable {