summaryrefslogtreecommitdiff
path: root/script/files.lua
diff options
context:
space:
mode:
authorGowa2017 <33367355+Gowa2017@users.noreply.github.com>2021-10-30 22:43:44 +0800
committerGowa2017 <33367355+Gowa2017@users.noreply.github.com>2021-10-30 22:43:44 +0800
commitfcfe4df428f333fb255df01fa42154da115506b4 (patch)
tree0fa5db490a73ff0a94783930eba914b5f7b49426 /script/files.lua
parent7ecf5a64207aefcdcb5dc0469580394293dce85b (diff)
parentb5beff286df3d57a8c0ab6fa3ead9da3f08fb1b4 (diff)
downloadlua-language-server-fcfe4df428f333fb255df01fa42154da115506b4.zip
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'script/files.lua')
-rw-r--r--script/files.lua7
1 files changed, 6 insertions, 1 deletions
diff --git a/script/files.lua b/script/files.lua
index 4d649b29..29a66d48 100644
--- a/script/files.lua
+++ b/script/files.lua
@@ -120,10 +120,15 @@ end
--- 设置文件文本
---@param uri uri
---@param text string
-function m.setText(uri, text, isTrust, instance)
+function m.setText(uri, text, isTrust)
if not text then
return
end
+ if #text > 1024 * 1024 * 100 then
+ local client = require 'client'
+ client.showMessage('Warning', lang.script('WORKSPACE_SKIP_HUGE_FILE', uri))
+ return
+ end
--log.debug('setText', uri)
local create
if not m.fileMap[uri] then