summaryrefslogtreecommitdiff
path: root/script/core/formatting.lua
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 /script/core/formatting.lua
parentc700a5fc23e00f95166e883764276a6f61803d4e (diff)
downloadlua-language-server-8da719f8c063b7b8f8a99d1e98201e44a13fab1f.zip
fix wront indent of VSCode
Diffstat (limited to 'script/core/formatting.lua')
-rw-r--r--script/core/formatting.lua5
1 files changed, 4 insertions, 1 deletions
diff --git a/script/core/formatting.lua b/script/core/formatting.lua
index fb5ca9c7..de7f30ed 100644
--- a/script/core/formatting.lua
+++ b/script/core/formatting.lua
@@ -1,8 +1,11 @@
-local codeFormat = require("code_format")
local files = require("files")
local log = require("log")
return function(uri, options)
+ local suc, codeFormat = pcall(require, "code_format")
+ if not suc then
+ return
+ end
local text = files.getOriginText(uri)
local state = files.getState(uri)
if not state then