summaryrefslogtreecommitdiff
path: root/script
diff options
context:
space:
mode:
Diffstat (limited to 'script')
-rw-r--r--script/config/template.lua12
-rw-r--r--script/provider/diagnostic.lua2
-rw-r--r--script/provider/provider.lua4
-rw-r--r--script/workspace/workspace.lua4
4 files changed, 8 insertions, 14 deletions
diff --git a/script/config/template.lua b/script/config/template.lua
index 45310c7e..c37a6262 100644
--- a/script/config/template.lua
+++ b/script/config/template.lua
@@ -218,9 +218,7 @@ local template = {
>> util.deepCopy(define.DiagnosticDefaultSeverity),
['Lua.diagnostics.neededFileStatus'] = Type.Hash(Type.String, Type.String)
>> util.deepCopy(define.DiagnosticDefaultNeededFileStatus),
- ['Lua.diagnostics.disableScheme'] = Type.Hash(Type.String, Type.Boolean, ';') >> {
- ['git'] = true,
- },
+ ['Lua.diagnostics.disableScheme'] = Type.Array(Type.String) >> { 'git' },
['Lua.diagnostics.workspaceDelay'] = Type.Integer >> 5,
['Lua.diagnostics.workspaceRate'] = Type.Integer >> 100,
['Lua.diagnostics.libraryFiles'] = Type.String >> 'Opened' << {
@@ -238,14 +236,10 @@ local template = {
['Lua.workspace.useGitIgnore'] = Type.Boolean >> true,
['Lua.workspace.maxPreload'] = Type.Integer >> 3000,
['Lua.workspace.preloadFileSize'] = Type.Integer >> 500,
- ['Lua.workspace.library'] = Type.Hash(Type.String, Type.Boolean, ';'),
+ ['Lua.workspace.library'] = Type.Array(Type.String),
['Lua.workspace.checkThirdParty'] = Type.Boolean >> true,
['Lua.workspace.userThirdParty'] = Type.Array(Type.String),
- ['Lua.workspace.supportScheme'] = Type.Hash(Type.String, Type.Boolean, ';') >> {
- ['file'] = true,
- ['untitled'] = true,
- ['git'] = true,
- },
+ ['Lua.workspace.supportScheme'] = Type.Array(Type.String) >> { 'file', 'untitled', 'git' },
['Lua.completion.enable'] = Type.Boolean >> true,
['Lua.completion.callSnippet'] = Type.String >> 'Disable' << {
'Disable',
diff --git a/script/provider/diagnostic.lua b/script/provider/diagnostic.lua
index d6d6c4a3..5957e3eb 100644
--- a/script/provider/diagnostic.lua
+++ b/script/provider/diagnostic.lua
@@ -236,7 +236,7 @@ local function isValid(uri)
end
local scheme = furi.split(uri)
local disableScheme = config.get(uri, 'Lua.diagnostics.disableScheme')
- if disableScheme[scheme] then
+ if util.arrayHas(disableScheme, scheme) then
return false
end
return true
diff --git a/script/provider/provider.lua b/script/provider/provider.lua
index af78cd26..ad23ccda 100644
--- a/script/provider/provider.lua
+++ b/script/provider/provider.lua
@@ -239,7 +239,7 @@ m.register 'textDocument/didOpen' {
local doc = params.textDocument
local scheme = furi.split(doc.uri)
local supports = config.get(doc.uri, 'Lua.workspace.supportScheme')
- if not supports[scheme] then
+ if not util.arrayHas(supports, scheme) then
return
end
local uri = files.getRealUri(doc.uri)
@@ -269,7 +269,7 @@ m.register 'textDocument/didChange' {
local doc = params.textDocument
local scheme = furi.split(doc.uri)
local supports = config.get(doc.uri, 'Lua.workspace.supportScheme')
- if not supports[scheme] then
+ if not util.arrayHas(supports, scheme) then
return
end
local changes = params.contentChanges
diff --git a/script/workspace/workspace.lua b/script/workspace/workspace.lua
index 33252b9d..4c0011b3 100644
--- a/script/workspace/workspace.lua
+++ b/script/workspace/workspace.lua
@@ -141,7 +141,7 @@ function m.getNativeMatcher(scp)
end
end
end
- for path in pairs(config.get(scp.uri, 'Lua.workspace.library')) do
+ for _, path in ipairs(config.get(scp.uri, 'Lua.workspace.library')) do
path = m.getAbsolutePath(scp.uri, path)
if path then
log.debug('Ignore by library:', path)
@@ -183,7 +183,7 @@ function m.getLibraryMatchers(scp)
end
local librarys = {}
- for path in pairs(config.get(scp.uri, 'Lua.workspace.library')) do
+ for _, path in ipairs(config.get(scp.uri, 'Lua.workspace.library')) do
path = m.getAbsolutePath(scp.uri, path)
if path then
librarys[m.normalize(path)] = true