Skip to content

Commit 7b58d50

Browse files
authored
Merge pull request #126 from notpeter/NLS_fix
Fixes #72: "[lua]: Couldn't find message for key config.*" console spam.
2 parents 2aaab95 + 64ced73 commit 7b58d50

9 files changed

+271
-273
lines changed

build-settings.lua

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,10 @@ for dirPath in fs.pairs(fs.path 'server/locale') do
8585
type = 'object',
8686
properties = copyWithNLS(configuration, function (str)
8787
return str:gsub('^%%(.+)%%$', function (key)
88-
if nls[key] then
89-
return nls[key]
90-
else
91-
nls[key] = ''
92-
return ''
88+
if not nls[key] then
89+
nls[key] = "TODO: Needs documentation"
9390
end
91+
return nls[key]
9492
end)
9593
end),
9694
}

package.nls.json

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"config.diagnostics.await-in-sync": "Enable diagnostics for calls of asynchronous functions within a synchronous function.",
3838
"config.diagnostics.cast-local-type": "Enable diagnostics for casts of local variables where the target type does not match the defined type.",
3939
"config.diagnostics.cast-type-mismatch": "Enable diagnostics for casts where the target type does not match the initial type.",
40-
"config.diagnostics.circle-doc-class": "",
40+
"config.diagnostics.circle-doc-class": "TODO: Needs documentation",
4141
"config.diagnostics.circular-doc-class": "Enable diagnostics for two classes inheriting from each other introducing a circular relation.",
4242
"config.diagnostics.close-non-object": "Enable diagnostics for attempts to close a variable with a non-object.",
4343
"config.diagnostics.code-after-break": "Enable diagnostics for code placed after a break statement in a loop.",
@@ -70,15 +70,15 @@
7070
"config.diagnostics.ignoredFiles.Enable": "Always diagnose these files.",
7171
"config.diagnostics.ignoredFiles.Opened": "Only when these files are opened will it be diagnosed.",
7272
"config.diagnostics.incomplete-signature-doc": "Incomplete @param or @return annotations for functions.",
73-
"config.diagnostics.inject-field": "",
73+
"config.diagnostics.inject-field": "TODO: Needs documentation",
7474
"config.diagnostics.invisible": "Enable diagnostics for accesses to fields which are invisible.",
7575
"config.diagnostics.libraryFiles": "How to diagnose files loaded via `Lua.workspace.library`.",
7676
"config.diagnostics.libraryFiles.Disable": "These files are not diagnosed.",
7777
"config.diagnostics.libraryFiles.Enable": "Always diagnose these files.",
7878
"config.diagnostics.libraryFiles.Opened": "Only when these files are opened will it be diagnosed.",
7979
"config.diagnostics.lowercase-global": "Enable lowercase global variable definition diagnostics.",
8080
"config.diagnostics.luadoc": "* circle-doc-class\n* doc-field-no-class\n* duplicate-doc-alias\n* duplicate-doc-field\n* duplicate-doc-param\n* incomplete-signature-doc\n* missing-global-doc\n* missing-local-export-doc\n* undefined-doc-class\n* undefined-doc-name\n* undefined-doc-param\n* unknown-cast-variable\n* unknown-diag-code\n* unknown-operator",
81-
"config.diagnostics.missing-fields": "",
81+
"config.diagnostics.missing-fields": "TODO: Needs documentation",
8282
"config.diagnostics.missing-global-doc": "Missing annotations for globals! Global functions must have a comment and annotations for all parameters and return values.",
8383
"config.diagnostics.missing-local-export-doc": "Missing annotations for exported locals! Exported local functions must have a comment and annotations for all parameters and return values.",
8484
"config.diagnostics.missing-parameter": "Enable diagnostics for function calls where the number of arguments is less than the number of annotated function parameters.",
@@ -164,31 +164,31 @@
164164
"config.misc.parameters": "[Command line parameters](https://github.com/LuaLS/lua-telemetry-server/tree/master/method) when starting the language server in VSCode.",
165165
"config.nameStyle.config": "Set name style config",
166166
"config.runtime.builtin": "Adjust the enabled state of the built-in library. You can disable (or redefine) the non-existent library according to the actual runtime environment.\n\n* `default`: Indicates that the library will be enabled or disabled according to the runtime version\n* `enable`: always enable\n* `disable`: always disable\n",
167-
"config.runtime.builtin.basic": "",
168-
"config.runtime.builtin.bit": "",
169-
"config.runtime.builtin.bit32": "",
170-
"config.runtime.builtin.builtin": "",
171-
"config.runtime.builtin.coroutine": "",
172-
"config.runtime.builtin.debug": "",
173-
"config.runtime.builtin.ffi": "",
174-
"config.runtime.builtin.io": "",
175-
"config.runtime.builtin.jit": "",
176-
"config.runtime.builtin.jit.profile": "",
177-
"config.runtime.builtin.jit.util": "",
178-
"config.runtime.builtin.math": "",
179-
"config.runtime.builtin.os": "",
180-
"config.runtime.builtin.package": "",
181-
"config.runtime.builtin.string": "",
182-
"config.runtime.builtin.string.buffer": "",
183-
"config.runtime.builtin.table": "",
184-
"config.runtime.builtin.table.clear": "",
185-
"config.runtime.builtin.table.new": "",
186-
"config.runtime.builtin.utf8": "",
167+
"config.runtime.builtin.basic": "TODO: Needs documentation",
168+
"config.runtime.builtin.bit": "TODO: Needs documentation",
169+
"config.runtime.builtin.bit32": "TODO: Needs documentation",
170+
"config.runtime.builtin.builtin": "TODO: Needs documentation",
171+
"config.runtime.builtin.coroutine": "TODO: Needs documentation",
172+
"config.runtime.builtin.debug": "TODO: Needs documentation",
173+
"config.runtime.builtin.ffi": "TODO: Needs documentation",
174+
"config.runtime.builtin.io": "TODO: Needs documentation",
175+
"config.runtime.builtin.jit": "TODO: Needs documentation",
176+
"config.runtime.builtin.jit.profile": "TODO: Needs documentation",
177+
"config.runtime.builtin.jit.util": "TODO: Needs documentation",
178+
"config.runtime.builtin.math": "TODO: Needs documentation",
179+
"config.runtime.builtin.os": "TODO: Needs documentation",
180+
"config.runtime.builtin.package": "TODO: Needs documentation",
181+
"config.runtime.builtin.string": "TODO: Needs documentation",
182+
"config.runtime.builtin.string.buffer": "TODO: Needs documentation",
183+
"config.runtime.builtin.table": "TODO: Needs documentation",
184+
"config.runtime.builtin.table.clear": "TODO: Needs documentation",
185+
"config.runtime.builtin.table.new": "TODO: Needs documentation",
186+
"config.runtime.builtin.utf8": "TODO: Needs documentation",
187187
"config.runtime.fileEncoding": "File encoding. The `ansi` option is only available under the `Windows` platform.",
188-
"config.runtime.fileEncoding.ansi": "",
189-
"config.runtime.fileEncoding.utf16be": "",
190-
"config.runtime.fileEncoding.utf16le": "",
191-
"config.runtime.fileEncoding.utf8": "",
188+
"config.runtime.fileEncoding.ansi": "TODO: Needs documentation",
189+
"config.runtime.fileEncoding.utf16be": "TODO: Needs documentation",
190+
"config.runtime.fileEncoding.utf16le": "TODO: Needs documentation",
191+
"config.runtime.fileEncoding.utf8": "TODO: Needs documentation",
192192
"config.runtime.meta": "Format of the directory name of the meta files.",
193193
"config.runtime.nonstandardSymbol": "Supports non-standard symbols. Make sure that your runtime environment supports these symbols.",
194194
"config.runtime.path": "When using `require`, how to find the file based on the input name.\nSetting this config to `?/init.lua` means that when you enter `require 'myfile'`, `${workspace}/myfile/init.lua` will be searched from the loaded files.\nif `runtime.pathStrict` is `false`, `${workspace}/**/myfile/init.lua` will also be searched.\nIf you want to load files outside the workspace, you need to set `Lua.workspace.library` first.\n",
@@ -198,11 +198,11 @@
198198
"config.runtime.special": "The custom global variables are regarded as some special built-in variables, and the language server will provide special support\nThe following example shows that 'include' is treated as' require '.\n```json\n\"Lua.runtime.special\" : {\n \"include\" : \"require\"\n}\n```\n",
199199
"config.runtime.unicodeName": "Allows Unicode characters in name.",
200200
"config.runtime.version": "Lua runtime version.",
201-
"config.runtime.version.Lua 5.1": "",
202-
"config.runtime.version.Lua 5.2": "",
203-
"config.runtime.version.Lua 5.3": "",
204-
"config.runtime.version.Lua 5.4": "",
205-
"config.runtime.version.LuaJIT": "",
201+
"config.runtime.version.Lua 5.1": "TODO: Needs documentation",
202+
"config.runtime.version.Lua 5.2": "TODO: Needs documentation",
203+
"config.runtime.version.Lua 5.3": "TODO: Needs documentation",
204+
"config.runtime.version.Lua 5.4": "TODO: Needs documentation",
205+
"config.runtime.version.LuaJIT": "TODO: Needs documentation",
206206
"config.semantic.annotation": "Semantic coloring of type annotations.",
207207
"config.semantic.enable": "Enable semantic color. You may need to set `editor.semanticHighlighting.enabled` to `true` to take effect.",
208208
"config.semantic.keyword": "Semantic coloring of keywords/literals/operators. You only need to enable this feature if your editor cannot do syntax coloring.",

package.nls.pt-br.json

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"config.diagnostics.await-in-sync": "Enable diagnostics for calls of asynchronous functions within a synchronous function.",
3838
"config.diagnostics.cast-local-type": "Enable diagnostics for casts of local variables where the target type does not match the defined type.",
3939
"config.diagnostics.cast-type-mismatch": "Enable diagnostics for casts where the target type does not match the initial type.",
40-
"config.diagnostics.circle-doc-class": "",
40+
"config.diagnostics.circle-doc-class": "TODO: Needs documentation",
4141
"config.diagnostics.circular-doc-class": "Enable diagnostics for two classes inheriting from each other introducing a circular relation.",
4242
"config.diagnostics.close-non-object": "Enable diagnostics for attempts to close a variable with a non-object.",
4343
"config.diagnostics.code-after-break": "Enable diagnostics for code placed after a break statement in a loop.",
@@ -70,15 +70,15 @@
7070
"config.diagnostics.ignoredFiles.Enable": "Always diagnose these files.",
7171
"config.diagnostics.ignoredFiles.Opened": "Only when these files are opened will it be diagnosed.",
7272
"config.diagnostics.incomplete-signature-doc": "Incomplete @param or @return annotations for functions.",
73-
"config.diagnostics.inject-field": "",
73+
"config.diagnostics.inject-field": "TODO: Needs documentation",
7474
"config.diagnostics.invisible": "Enable diagnostics for accesses to fields which are invisible.",
7575
"config.diagnostics.libraryFiles": "How to diagnose files loaded via `Lua.workspace.library`.",
7676
"config.diagnostics.libraryFiles.Disable": "These files are not diagnosed.",
7777
"config.diagnostics.libraryFiles.Enable": "Always diagnose these files.",
7878
"config.diagnostics.libraryFiles.Opened": "Only when these files are opened will it be diagnosed.",
7979
"config.diagnostics.lowercase-global": "首字母小写的全局变量定义",
8080
"config.diagnostics.luadoc": "* circle-doc-class\n* doc-field-no-class\n* duplicate-doc-alias\n* duplicate-doc-field\n* duplicate-doc-param\n* incomplete-signature-doc\n* missing-global-doc\n* missing-local-export-doc\n* undefined-doc-class\n* undefined-doc-name\n* undefined-doc-param\n* unknown-cast-variable\n* unknown-diag-code\n* unknown-operator",
81-
"config.diagnostics.missing-fields": "",
81+
"config.diagnostics.missing-fields": "TODO: Needs documentation",
8282
"config.diagnostics.missing-global-doc": "Missing annotations for globals! Global functions must have a comment and annotations for all parameters and return values.",
8383
"config.diagnostics.missing-local-export-doc": "Missing annotations for exported locals! Exported local functions must have a comment and annotations for all parameters and return values.",
8484
"config.diagnostics.missing-parameter": "Enable diagnostics for function calls where the number of arguments is less than the number of annotated function parameters.",
@@ -164,31 +164,31 @@
164164
"config.misc.parameters": "[Command line parameters](https://github.com/LuaLS/lua-telemetry-server/tree/master/method) when starting the language service in VSCode.",
165165
"config.nameStyle.config": "Set name style config",
166166
"config.runtime.builtin": "Adjust the enabled state of the built-in library. You can disable (or redefine) the non-existent library according to the actual runtime environment.\n\n* `default`: Indicates that the library will be enabled or disabled according to the runtime version\n* `enable`: always enable\n* `disable`: always disable\n",
167-
"config.runtime.builtin.basic": "",
168-
"config.runtime.builtin.bit": "",
169-
"config.runtime.builtin.bit32": "",
170-
"config.runtime.builtin.builtin": "",
171-
"config.runtime.builtin.coroutine": "",
172-
"config.runtime.builtin.debug": "",
173-
"config.runtime.builtin.ffi": "",
174-
"config.runtime.builtin.io": "",
175-
"config.runtime.builtin.jit": "",
176-
"config.runtime.builtin.jit.profile": "",
177-
"config.runtime.builtin.jit.util": "",
178-
"config.runtime.builtin.math": "",
179-
"config.runtime.builtin.os": "",
180-
"config.runtime.builtin.package": "",
181-
"config.runtime.builtin.string": "",
182-
"config.runtime.builtin.string.buffer": "",
183-
"config.runtime.builtin.table": "",
184-
"config.runtime.builtin.table.clear": "",
185-
"config.runtime.builtin.table.new": "",
186-
"config.runtime.builtin.utf8": "",
167+
"config.runtime.builtin.basic": "TODO: Needs documentation",
168+
"config.runtime.builtin.bit": "TODO: Needs documentation",
169+
"config.runtime.builtin.bit32": "TODO: Needs documentation",
170+
"config.runtime.builtin.builtin": "TODO: Needs documentation",
171+
"config.runtime.builtin.coroutine": "TODO: Needs documentation",
172+
"config.runtime.builtin.debug": "TODO: Needs documentation",
173+
"config.runtime.builtin.ffi": "TODO: Needs documentation",
174+
"config.runtime.builtin.io": "TODO: Needs documentation",
175+
"config.runtime.builtin.jit": "TODO: Needs documentation",
176+
"config.runtime.builtin.jit.profile": "TODO: Needs documentation",
177+
"config.runtime.builtin.jit.util": "TODO: Needs documentation",
178+
"config.runtime.builtin.math": "TODO: Needs documentation",
179+
"config.runtime.builtin.os": "TODO: Needs documentation",
180+
"config.runtime.builtin.package": "TODO: Needs documentation",
181+
"config.runtime.builtin.string": "TODO: Needs documentation",
182+
"config.runtime.builtin.string.buffer": "TODO: Needs documentation",
183+
"config.runtime.builtin.table": "TODO: Needs documentation",
184+
"config.runtime.builtin.table.clear": "TODO: Needs documentation",
185+
"config.runtime.builtin.table.new": "TODO: Needs documentation",
186+
"config.runtime.builtin.utf8": "TODO: Needs documentation",
187187
"config.runtime.fileEncoding": "File encoding. The `ansi` option is only available under the `Windows` platform.",
188-
"config.runtime.fileEncoding.ansi": "",
189-
"config.runtime.fileEncoding.utf16be": "",
190-
"config.runtime.fileEncoding.utf16le": "",
191-
"config.runtime.fileEncoding.utf8": "",
188+
"config.runtime.fileEncoding.ansi": "TODO: Needs documentation",
189+
"config.runtime.fileEncoding.utf16be": "TODO: Needs documentation",
190+
"config.runtime.fileEncoding.utf16le": "TODO: Needs documentation",
191+
"config.runtime.fileEncoding.utf8": "TODO: Needs documentation",
192192
"config.runtime.meta": "Format of the directory name of the meta files.",
193193
"config.runtime.nonstandardSymbol": "Supports non-standard symbols. Make sure that your runtime environment supports these symbols.",
194194
"config.runtime.path": "When using `require`, how to find the file based on the input name.\nSetting this config to `?/init.lua` means that when you enter `require 'myfile'`, `${workspace}/myfile/init.lua` will be searched from the loaded files.\nif `runtime.pathStrict` is `false`, `${workspace}/**/myfile/init.lua` will also be searched.\nIf you want to load files outside the workspace, you need to set `Lua.workspace.library` first.\n",
@@ -198,11 +198,11 @@
198198
"config.runtime.special": "The custom global variables are regarded as some special built-in variables, and the language server will provide special support\nThe following example shows that 'include' is treated as' require '.\n```json\n\"Lua.runtime.special\" : {\n \"include\" : \"require\"\n}\n```\n",
199199
"config.runtime.unicodeName": "Allows Unicode characters in name.",
200200
"config.runtime.version": "Lua runtime version.",
201-
"config.runtime.version.Lua 5.1": "",
202-
"config.runtime.version.Lua 5.2": "",
203-
"config.runtime.version.Lua 5.3": "",
204-
"config.runtime.version.Lua 5.4": "",
205-
"config.runtime.version.LuaJIT": "",
201+
"config.runtime.version.Lua 5.1": "TODO: Needs documentation",
202+
"config.runtime.version.Lua 5.2": "TODO: Needs documentation",
203+
"config.runtime.version.Lua 5.3": "TODO: Needs documentation",
204+
"config.runtime.version.Lua 5.4": "TODO: Needs documentation",
205+
"config.runtime.version.LuaJIT": "TODO: Needs documentation",
206206
"config.semantic.annotation": "Semantic coloring of type annotations.",
207207
"config.semantic.enable": "Enable semantic color. You may need to set `editor.semanticHighlighting.enabled` to `true` to take effect.",
208208
"config.semantic.keyword": "Semantic coloring of keywords/literals/operators. You only need to enable this feature if your editor cannot do syntax coloring.",

0 commit comments

Comments
 (0)