diff options
author | Gowa2017 <33367355+Gowa2017@users.noreply.github.com> | 2021-10-30 22:43:44 +0800 |
---|---|---|
committer | Gowa2017 <33367355+Gowa2017@users.noreply.github.com> | 2021-10-30 22:43:44 +0800 |
commit | fcfe4df428f333fb255df01fa42154da115506b4 (patch) | |
tree | 0fa5db490a73ff0a94783930eba914b5f7b49426 /script/files.lua | |
parent | 7ecf5a64207aefcdcb5dc0469580394293dce85b (diff) | |
parent | b5beff286df3d57a8c0ab6fa3ead9da3f08fb1b4 (diff) | |
download | lua-language-server-fcfe4df428f333fb255df01fa42154da115506b4.zip |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'script/files.lua')
-rw-r--r-- | script/files.lua | 7 |
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 |