Skip to content

Commit cffa4e2

Browse files
committed
add "robloxLsp.workspace.loadRequiredFiles"
1 parent 550b6ab commit cffa4e2

File tree

4 files changed

+18
-10
lines changed

4 files changed

+18
-10
lines changed

package.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1158,6 +1158,12 @@
11581158
"scope": "resource",
11591159
"type": "boolean"
11601160
},
1161+
"robloxLsp.workspace.loadRequiredFiles": {
1162+
"default": true,
1163+
"markdownDescription": "%config.workspace.loadRequiredFiles%",
1164+
"scope": "resource",
1165+
"type": "boolean"
1166+
},
11611167
"robloxLsp.runtime.fileEncoding": {
11621168
"default": "utf8",
11631169
"enum": [

package.nls.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
"config.workspace.loadMode": "What files should be preloaded.",
4242
"config.workspace.loadMode.allFiles": "Load all files in workspace.",
4343
"config.workspace.loadMode.rojoProject": "Load all files found in Rojo Project.",
44+
"config.workspace.loadRequiredFiles": "Load files without diagnostics when they are required by other files even if they are ignored.",
4445
"config.misc.color3Picker": "Enable Color Picker and Preview for Color3 functions.",
4546
"config.misc.serviceAutoImport": "Suggests Roblox Services that can be auto imported.",
4647
"config.misc.goToScriptLink": "If enabled, shows a link to the source script when requiring a module.",

server/script/config.lua

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -146,15 +146,16 @@ local ConfigTemplate = {
146146
workspaceRate = {100, Integer},
147147
},
148148
workspace = {
149-
ignoreDir = {{}, Str2Hash ';'},
150-
ignoreSubmodules= {true, Boolean},
151-
rojoProjectFile = {"default", String},
152-
loadMode = {'All Files', String},
153-
useGitIgnore = {true, Boolean},
154-
useFilesExclude = {true, Boolean},
155-
maxPreload = {1000, Integer},
156-
preloadFileSize = {100, Integer},
157-
library = {{}, Array2Hash(String)},
149+
ignoreDir = {{}, Str2Hash ';'},
150+
ignoreSubmodules = {true, Boolean},
151+
rojoProjectFile = {"default", String},
152+
loadMode = {'All Files', String},
153+
useGitIgnore = {true, Boolean},
154+
useFilesExclude = {true, Boolean},
155+
loadRequiredFiles = {true, Boolean},
156+
maxPreload = {1000, Integer},
157+
preloadFileSize = {100, Integer},
158+
library = {{}, Array2Hash(String)},
158159
},
159160
completion = {
160161
enable = {true, Boolean},

server/script/workspace/workspace.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ function m.awaitPreload()
329329
end
330330

331331
function m.load(uri)
332-
if files.isLua(uri) then
332+
if config.config.workspace.loadRequiredFiles and files.isLua(uri) then
333333
await.delay()
334334
local text = util.loadFile(furi.decode(uri))
335335
if text then

0 commit comments

Comments
 (0)