summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-08-29 20:03:23 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-08-29 20:03:23 +0800
commit8da719f8c063b7b8f8a99d1e98201e44a13fab1f (patch)
treef4c1c6949a8f33a011321c3511d190e4cc6a6792 /test
parentc700a5fc23e00f95166e883764276a6f61803d4e (diff)
downloadlua-language-server-8da719f8c063b7b8f8a99d1e98201e44a13fab1f.zip
fix wront indent of VSCode
Diffstat (limited to 'test')
-rw-r--r--test/type_formatting/init.lua86
1 files changed, 81 insertions, 5 deletions
diff --git a/test/type_formatting/init.lua b/test/type_formatting/init.lua
index 0e2873b9..08c978b7 100644
--- a/test/type_formatting/init.lua
+++ b/test/type_formatting/init.lua
@@ -117,17 +117,93 @@ TEST [[
}
TEST [[
-if true then
+local x = 1
+<??>
+]]
+{
+ ch = '\n',
+ edits = nil,
+}
+
+TEST [[
+local x = 'if 1 then'
+ <??>
+]]
+{
+ ch = '\n',
+ edits = {
+ {
+ start = 10000,
+ finish = 10004,
+ text = '',
+ }
+ }
+}
+
+TEST [[
+local x = 'do'
+ <??>
+]]
+{
+ ch = '\n',
+ edits = {
+ {
+ start = 10000,
+ finish = 10004,
+ text = '',
+ }
+ }
+}
+
+TEST [[
+local x = 'function'
<??>
-end
]]
{
ch = '\n',
edits = {
{
- start = 0,
- finish = 10000,
- text = 'if true then\n',
+ start = 10000,
+ finish = 10004,
+ text = '',
}
}
}
+
+TEST [[
+do
+ <??>
+]]
+{
+ ch = '\n',
+ edits = nil
+}
+
+TEST [[
+do
+ <??>
+end
+]]
+{
+ ch = '\n',
+ edits = nil
+}
+
+TEST [[
+function ()
+ <??>
+]]
+{
+ ch = '\n',
+ edits = nil
+}
+
+TEST [[
+function ()
+ <??>
+end
+]]
+{
+ ch = '\n',
+ edits = nil
+}