diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-08-29 20:03:23 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-08-29 20:03:23 +0800 |
commit | 8da719f8c063b7b8f8a99d1e98201e44a13fab1f (patch) | |
tree | f4c1c6949a8f33a011321c3511d190e4cc6a6792 /test | |
parent | c700a5fc23e00f95166e883764276a6f61803d4e (diff) | |
download | lua-language-server-8da719f8c063b7b8f8a99d1e98201e44a13fab1f.zip |
fix wront indent of VSCode
Diffstat (limited to 'test')
-rw-r--r-- | test/type_formatting/init.lua | 86 |
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 +} |