summaryrefslogtreecommitdiff
path: root/script/core
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-06-20 16:03:09 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-06-20 16:03:09 +0800
commitea94ae75080956dd49608d2a870f45f4c6ff82d8 (patch)
tree124e3e028243f77c1fcb2be71b8f879b30118f7f /script/core
parent99691a901cc26bc44720ced49729d436a09129ba (diff)
downloadlua-language-server-ea94ae75080956dd49608d2a870f45f4c6ff82d8.zip
use preview
Diffstat (limited to 'script/core')
-rw-r--r--script/core/diagnostics/assign-type-mismatch.lua3
-rw-r--r--script/core/diagnostics/cast-local-type.lua3
2 files changed, 6 insertions, 0 deletions
diff --git a/script/core/diagnostics/assign-type-mismatch.lua b/script/core/diagnostics/assign-type-mismatch.lua
index 168106a6..aae4cccb 100644
--- a/script/core/diagnostics/assign-type-mismatch.lua
+++ b/script/core/diagnostics/assign-type-mismatch.lua
@@ -16,6 +16,9 @@ local checkTypes = {
---@async
return function (uri, callback)
+ if not PREVIEW then
+ return
+ end
local state = files.getState(uri)
if not state then
return
diff --git a/script/core/diagnostics/cast-local-type.lua b/script/core/diagnostics/cast-local-type.lua
index ea14ffb6..0a236084 100644
--- a/script/core/diagnostics/cast-local-type.lua
+++ b/script/core/diagnostics/cast-local-type.lua
@@ -6,6 +6,9 @@ local await = require 'await'
---@async
return function (uri, callback)
+ if not PREVIEW then
+ return
+ end
local state = files.getState(uri)
if not state then
return