From e4f7cc7db593db63dcbc63e8f3af8666e1e51c30 Mon Sep 17 00:00:00 2001 From: LJ Sonic <lamr@free.fr> Date: Mon, 25 Mar 2024 16:06:30 +0100 Subject: [PATCH] Add diagnostics.ignoredConstantPrefixes setting --- package.json | 17 +++++++++++++++++ package.nls.json | 1 + package.nls.pt-br.json | 1 + package.nls.zh-cn.json | 1 + package.nls.zh-tw.json | 1 + server | 2 +- setting/schema-pt-br.json | 20 ++++++++++++++++++++ setting/schema-zh-cn.json | 20 ++++++++++++++++++++ setting/schema-zh-tw.json | 20 ++++++++++++++++++++ setting/schema.json | 20 ++++++++++++++++++++ 10 files changed, 102 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index b44870d..cbe4179 100644 --- a/package.json +++ b/package.json @@ -594,6 +594,23 @@ "title": "groupSeverity", "type": "object" }, + "Lua.diagnostics.ignoredConstantPrefixes": { + "default": [ + "MT_", + "S_", + "sfx_", + "SKINCOLOR_", + "SPR_", + "SPR2_", + "TOL_" + ], + "items": { + "type": "string" + }, + "markdownDescription": "%config.diagnostics.ignoredConstantPrefixes%", + "scope": "resource", + "type": "array" + }, "Lua.diagnostics.ignoredFiles": { "default": "Opened", "enum": [ diff --git a/package.nls.json b/package.nls.json index d91ebd5..38501e7 100644 --- a/package.nls.json +++ b/package.nls.json @@ -66,6 +66,7 @@ "config.diagnostics.globals": "Defined global variables.", "config.diagnostics.groupFileStatus": "Modify the diagnostic needed file status in a group.\n\n* Opened: only diagnose opened files\n* Any: diagnose all files\n* None: disable this diagnostic\n\n`Fallback` means that diagnostics in this group are controlled by `diagnostics.neededFileStatus` separately.\nOther settings will override individual settings without end of `!`.\n", "config.diagnostics.groupSeverity": "Modify the diagnostic severity in a group.\n`Fallback` means that diagnostics in this group are controlled by `diagnostics.severity` separately.\nOther settings will override individual settings without end of `!`.\n", + "config.diagnostics.ignoredConstantPrefixes": "Global variables that start with one of these prefixes will be ignored when checking for undefined global variables.", "config.diagnostics.ignoredFiles": "How to diagnose ignored files.", "config.diagnostics.ignoredFiles.Disable": "These files are not diagnosed.", "config.diagnostics.ignoredFiles.Enable": "Always diagnose these files.", diff --git a/package.nls.pt-br.json b/package.nls.pt-br.json index 9613e1a..84b3195 100644 --- a/package.nls.pt-br.json +++ b/package.nls.pt-br.json @@ -66,6 +66,7 @@ "config.diagnostics.globals": "Defined global variables.", "config.diagnostics.groupFileStatus": "Modify the diagnostic needed file status in a group.\n\n* Opened: only diagnose opened files\n* Any: diagnose all files\n* None: disable this diagnostic\n\n`Fallback` means that diagnostics in this group are controlled by `diagnostics.neededFileStatus` separately.\nOther settings will override individual settings without end of `!`.\n", "config.diagnostics.groupSeverity": "Modify the diagnostic severity in a group.\n`Fallback` means that diagnostics in this group are controlled by `diagnostics.severity` separately.\nOther settings will override individual settings without end of `!`.\n", + "config.diagnostics.ignoredConstantPrefixes": "Global variables that start with one of these prefixes will be ignored when checking for undefined global variables.", "config.diagnostics.ignoredFiles": "How to diagnose ignored files.", "config.diagnostics.ignoredFiles.Disable": "These files are not diagnosed.", "config.diagnostics.ignoredFiles.Enable": "Always diagnose these files.", diff --git a/package.nls.zh-cn.json b/package.nls.zh-cn.json index dc97eea..dc17bad 100644 --- a/package.nls.zh-cn.json +++ b/package.nls.zh-cn.json @@ -66,6 +66,7 @@ "config.diagnostics.globals": "已定义的全局变量。", "config.diagnostics.groupFileStatus": "批量修改一个组中的文件状态。\n\n* Opened: 只诊断打开的文件\n* Any: 诊断任何文件\n* None: 禁用此诊断\n\n设置为 `Fallback` 意味着组中的诊断由 `diagnostics.neededFileStatus` 单独设置。\n其他设置将覆盖单独设置,但是不会覆盖以 `!` 结尾的设置。\n", "config.diagnostics.groupSeverity": "批量修改一个组中的诊断等级。\n设置为 `Fallback` 意味着组中的诊断由 `diagnostics.severity` 单独设置。\n其他设置将覆盖单独设置,但是不会覆盖以 `!` 结尾的设置。\n", + "config.diagnostics.ignoredConstantPrefixes": "Global variables that start with one of these prefixes will be ignored when checking for undefined global variables.", "config.diagnostics.ignoredFiles": "如何诊断被忽略的文件。", "config.diagnostics.ignoredFiles.Disable": "不诊断这些文件。", "config.diagnostics.ignoredFiles.Enable": "总是诊断这些文件。", diff --git a/package.nls.zh-tw.json b/package.nls.zh-tw.json index 762e661..f87b377 100644 --- a/package.nls.zh-tw.json +++ b/package.nls.zh-tw.json @@ -66,6 +66,7 @@ "config.diagnostics.globals": "已定義的全域變數。", "config.diagnostics.groupFileStatus": "批量修改一個組中的檔案狀態。\n\n* Opened: 只診斷打開的檔案\n* Any: 診斷所有檔案\n* None: 停用此診斷\n\n設定為 `Fallback` 意味著組中的診斷由 `diagnostics.neededFileStatus` 單獨設定。\n其他設定將覆蓋單獨設定,但是不會覆蓋以 `!` 結尾的設定。\n", "config.diagnostics.groupSeverity": "批量修改一個組中的診斷等級。\n設定為 `Fallback` 意味著組中的診斷由 `diagnostics.severity` 單獨設定。\n其他設定將覆蓋單獨設定,但是不會覆蓋以 `!` 結尾的設定。\n", + "config.diagnostics.ignoredConstantPrefixes": "Global variables that start with one of these prefixes will be ignored when checking for undefined global variables.", "config.diagnostics.ignoredFiles": "如何診斷被忽略的檔案。", "config.diagnostics.ignoredFiles.Disable": "不診斷這些檔案。", "config.diagnostics.ignoredFiles.Enable": "總是診斷這些檔案。", diff --git a/server b/server index aed9b51..8faf195 160000 --- a/server +++ b/server @@ -1 +1 @@ -Subproject commit aed9b5113eb1d9afc33301fd8413a04782330c8b +Subproject commit 8faf1954a49f79a7f7c99a930643266fb4a5ad24 diff --git a/setting/schema-pt-br.json b/setting/schema-pt-br.json index 7b9d9f2..37d9dbb 100644 --- a/setting/schema-pt-br.json +++ b/setting/schema-pt-br.json @@ -171,6 +171,9 @@ "groupSeverity": { "$ref": "#/properties/diagnostics.groupSeverity" }, + "ignoredConstantPrefixes": { + "$ref": "#/properties/diagnostics.ignoredConstantPrefixes" + }, "ignoredFiles": { "$ref": "#/properties/diagnostics.ignoredFiles" }, @@ -652,6 +655,23 @@ "title": "groupSeverity", "type": "object" }, + "diagnostics.ignoredConstantPrefixes": { + "default": [ + "MT_", + "S_", + "sfx_", + "SKINCOLOR_", + "SPR_", + "SPR2_", + "TOL_" + ], + "items": { + "type": "string" + }, + "markdownDescription": "Global variables that start with one of these prefixes will be ignored when checking for undefined global variables.", + "scope": "resource", + "type": "array" + }, "diagnostics.ignoredFiles": { "default": "Opened", "enum": [ diff --git a/setting/schema-zh-cn.json b/setting/schema-zh-cn.json index 4c5f4ba..f7dd56a 100644 --- a/setting/schema-zh-cn.json +++ b/setting/schema-zh-cn.json @@ -171,6 +171,9 @@ "groupSeverity": { "$ref": "#/properties/diagnostics.groupSeverity" }, + "ignoredConstantPrefixes": { + "$ref": "#/properties/diagnostics.ignoredConstantPrefixes" + }, "ignoredFiles": { "$ref": "#/properties/diagnostics.ignoredFiles" }, @@ -652,6 +655,23 @@ "title": "groupSeverity", "type": "object" }, + "diagnostics.ignoredConstantPrefixes": { + "default": [ + "MT_", + "S_", + "sfx_", + "SKINCOLOR_", + "SPR_", + "SPR2_", + "TOL_" + ], + "items": { + "type": "string" + }, + "markdownDescription": "Global variables that start with one of these prefixes will be ignored when checking for undefined global variables.", + "scope": "resource", + "type": "array" + }, "diagnostics.ignoredFiles": { "default": "Opened", "enum": [ diff --git a/setting/schema-zh-tw.json b/setting/schema-zh-tw.json index 278214d..86a7c33 100644 --- a/setting/schema-zh-tw.json +++ b/setting/schema-zh-tw.json @@ -171,6 +171,9 @@ "groupSeverity": { "$ref": "#/properties/diagnostics.groupSeverity" }, + "ignoredConstantPrefixes": { + "$ref": "#/properties/diagnostics.ignoredConstantPrefixes" + }, "ignoredFiles": { "$ref": "#/properties/diagnostics.ignoredFiles" }, @@ -652,6 +655,23 @@ "title": "groupSeverity", "type": "object" }, + "diagnostics.ignoredConstantPrefixes": { + "default": [ + "MT_", + "S_", + "sfx_", + "SKINCOLOR_", + "SPR_", + "SPR2_", + "TOL_" + ], + "items": { + "type": "string" + }, + "markdownDescription": "Global variables that start with one of these prefixes will be ignored when checking for undefined global variables.", + "scope": "resource", + "type": "array" + }, "diagnostics.ignoredFiles": { "default": "Opened", "enum": [ diff --git a/setting/schema.json b/setting/schema.json index 75ca47f..ff7aeb0 100644 --- a/setting/schema.json +++ b/setting/schema.json @@ -171,6 +171,9 @@ "groupSeverity": { "$ref": "#/properties/diagnostics.groupSeverity" }, + "ignoredConstantPrefixes": { + "$ref": "#/properties/diagnostics.ignoredConstantPrefixes" + }, "ignoredFiles": { "$ref": "#/properties/diagnostics.ignoredFiles" }, @@ -652,6 +655,23 @@ "title": "groupSeverity", "type": "object" }, + "diagnostics.ignoredConstantPrefixes": { + "default": [ + "MT_", + "S_", + "sfx_", + "SKINCOLOR_", + "SPR_", + "SPR2_", + "TOL_" + ], + "items": { + "type": "string" + }, + "markdownDescription": "Global variables that start with one of these prefixes will be ignored when checking for undefined global variables.", + "scope": "resource", + "type": "array" + }, "diagnostics.ignoredFiles": { "default": "Opened", "enum": [ -- GitLab