Skip to content

Commit 206db25

Browse files
committed
Lua.completion.displayContext
1 parent 7a15508 commit 206db25

File tree

10 files changed

+56
-15
lines changed

10 files changed

+56
-15
lines changed

package.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@
4848
"scope": "resource",
4949
"type": "string"
5050
},
51+
"Lua.completion.displayContext": {
52+
"default": 6,
53+
"markdownDescription": "%config.completion.displayContext%",
54+
"scope": "resource",
55+
"type": "integer"
56+
},
5157
"Lua.completion.enable": {
5258
"default": true,
5359
"markdownDescription": "%config.completion.enable%",

package.nls.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"config.completion.callSnippet.Both": "Shows `function name` and `call snippet`.",
77
"config.completion.callSnippet.Disable": "Only shows `function name`.",
88
"config.completion.callSnippet.Replace": "Only shows `call snippet.`",
9+
"config.completion.displayContext": "Previewing the relevant code snippet of the suggestion may help you understand the usage of the suggestion. The number set indicates the number of intercepted lines in the code fragment. If it is set to `0`, this feature can be disabled.",
910
"config.completion.enable": "Enable completion.",
1011
"config.completion.keywordSnippet": "Shows keyword syntax snippets.",
1112
"config.completion.keywordSnippet.Both": "Shows `keyword` and `syntax snippet`.",

package.nls.zh-cn.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"config.completion.callSnippet.Both": "显示 `函数名` 与 `调用片段`。",
77
"config.completion.callSnippet.Disable": "只显示 `函数名`。",
88
"config.completion.callSnippet.Replace": "只显示 `调用片段`。",
9+
"config.completion.displayContext": "预览建议的相关代码片段,可能可以帮助你了解这项建议的用法。设置的数字表示代码片段的截取行数,设置为`0`可以禁用此功能。",
910
"config.completion.enable": "启用自动完成。",
1011
"config.completion.keywordSnippet": "显示关键字语法片段",
1112
"config.completion.keywordSnippet.Both": "显示 `关键字` 与 `语法片段`。",

package/configuration.lua

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,12 @@ local config = {
134134
},
135135
markdownDescription = "%config.completion.keywordSnippet%"
136136
},
137+
['Lua.completion.displayContext'] = {
138+
scope = "resource",
139+
type = "integer",
140+
default = 6,
141+
markdownDescription = "%config.completion.displayContext%",
142+
},
137143
["Lua.color.mode"] = {
138144
scope = "resource",
139145
type = "string",

package/nls-zh-cn.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ return {
2626
['config.completion.keywordSnippet.Disable'] = "只显示 `关键字`。",
2727
['config.completion.keywordSnippet.Both'] = "显示 `关键字` 与 `语法片段`。",
2828
['config.completion.keywordSnippet.Replace'] = "只显示 `语法片段`。",
29+
['config.completion.displayContext'] = "预览建议的相关代码片段,可能可以帮助你了解这项建议的用法。设置的数字表示代码片段的截取行数,设置为`0`可以禁用此功能。",
2930
['config.color.mode'] = "着色模式。",
3031
['config.color.mode.Semantic'] = "语义着色(测试中。你的颜色主题必须要支持语义着色才有效。)。",
3132
['config.color.mode.Grammar'] = "语法着色。",

package/nls.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ The following example shows loaded files in `C:/lua` and `../lib` ,exclude `../l
2626
['config.completion.keywordSnippet.Disable'] = "Only shows `keyword`.",
2727
['config.completion.keywordSnippet.Both'] = "Shows `keyword` and `syntax snippet`.",
2828
['config.completion.keywordSnippet.Replace'] = "Only shows `syntax snippet`.",
29+
['config.completion.displayContext'] = "Previewing the relevant code snippet of the suggestion may help you understand the usage of the suggestion. The number set indicates the number of intercepted lines in the code fragment. If it is set to `0`, this feature can be disabled.",
2930
['config.color.mode'] = "Color mode.",
3031
['config.color.mode.Semantic'] = "Semantic color (Testing. Your color theme must support semantic coloring to be effective.).",
3132
['config.color.mode.Grammar'] = "Grammar color.",

publish.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ package.path = package.path
1717
.. ';' .. rootPath .. '/?.lua'
1818
ROOT = fs.path(rootPath)
1919
require 'package.build'
20+
dofile(rootPath .. 'setting/build.lua')
2021
local json = require 'json'
2122

2223
local function loadPackage()

server

setting/schema-zh-cn.json

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@
3232
"scope": "resource",
3333
"type": "string"
3434
},
35+
"Lua.completion.displayContext": {
36+
"default": 6,
37+
"markdownDescription": "预览建议的相关代码片段,可能可以帮助你了解这项建议的用法。设置的数字表示代码片段的截取行数,设置为`0`可以禁用此功能。",
38+
"scope": "resource",
39+
"type": "integer"
40+
},
3541
"Lua.completion.enable": {
3642
"default": true,
3743
"markdownDescription": "启用自动完成。",
@@ -76,7 +82,7 @@
7682
"items": {
7783
"type": "string"
7884
},
79-
"markdownDescription": "禁用的诊断(使用浮框括号内的代码)。\u000a```json\u000a\"Lua.diagnostics.disable\" : [\u000a \"unused-local\",\u000a \"lowercase-global\"\u000a]\u000a```\u000a",
85+
"markdownDescription": "禁用的诊断(使用浮框括号内的代码)。\n```json\n\"Lua.diagnostics.disable\" : [\n \"unused-local\",\n \"lowercase-global\"\n]\n```\n",
8086
"scope": "resource",
8187
"type": "array"
8288
},
@@ -90,12 +96,12 @@
9096
"items": {
9197
"type": "string"
9298
},
93-
"markdownDescription": "已定义的全局变量。\u000a```json\u000a\"Lua.diagnostics.globals\" : [\u000a \"GLOBAL1\",\u000a \"GLOBAL2\"\u000a]\u000a```\u000a",
99+
"markdownDescription": "已定义的全局变量。\n```json\n\"Lua.diagnostics.globals\" : [\n \"GLOBAL1\",\n \"GLOBAL2\"\n]\n```\n",
94100
"scope": "resource",
95101
"type": "array"
96102
},
97103
"Lua.diagnostics.severity": {
98-
"markdownDescription": "修改诊断等级。\u000a```json\u000a\"Lua.diagnostics.severity\" : {\u000a \"redefined-local\" : \"Warning\",\u000a \"emmy-lua\" : \"Hint\"\u000a}\u000a```\u000a",
104+
"markdownDescription": "修改诊断等级。\n```json\n\"Lua.diagnostics.severity\" : {\n \"redefined-local\" : \"Warning\",\n \"emmy-lua\" : \"Hint\"\n}\n```\n",
99105
"properties": {
100106
"ambiguity-1": {
101107
"default": "Warning",
@@ -360,8 +366,8 @@
360366
"Lua.runtime.path": {
361367
"default": [
362368
"?.lua",
363-
"?\/init.lua",
364-
"?\/?.lua"
369+
"?/init.lua",
370+
"?/?.lua"
365371
],
366372
"items": {
367373
"type": "string"
@@ -396,7 +402,7 @@
396402
"items": {
397403
"type": "string"
398404
},
399-
"markdownDescription": "忽略的目录(使用 `.gitignore` 语法)。\u000a```json\u000a\"Lua.workspace.ignoreDir\" : [\u000a \"temp\/*.*\",\u000a \"!temp\/*.lua\"\u000a]\u000a```\u000a",
405+
"markdownDescription": "忽略的目录(使用 `.gitignore` 语法)。\n```json\n\"Lua.workspace.ignoreDir\" : [\n \"temp/*.*\",\n \"!temp/*.lua\"\n]\n```\n",
400406
"scope": "resource",
401407
"type": "array"
402408
},
@@ -407,7 +413,7 @@
407413
"type": "boolean"
408414
},
409415
"Lua.workspace.library": {
410-
"markdownDescription": "加载外部函数库。\u000a该功能可以加载外部的Lua文件,用于函数定义、自动完成等功能。注意,语言服务不会监视外部文件的变化,如果修改了外部文件需要重启。\u000a下面这个例子表示加载`C:\/lua`与`..\/lib`中的所有文件,但不加载`..\/lib\/temp`中的文件。\u000a```json\u000a\"Lua.workspace.library\": {\u000a \"C:\/lua\": true,\u000a \"..\/lib\": [\u000a \"temp\/*\"\u000a ]\u000a}\u000a```\u000a",
416+
"markdownDescription": "加载外部函数库。\n该功能可以加载外部的Lua文件,用于函数定义、自动完成等功能。注意,语言服务不会监视外部文件的变化,如果修改了外部文件需要重启。\n下面这个例子表示加载`C:/lua`与`../lib`中的所有文件,但不加载`../lib/temp`中的文件。\n```json\n\"Lua.workspace.library\": {\n \"C:/lua\": true,\n \"../lib\": [\n \"temp/*\"\n ]\n}\n```\n",
411417
"scope": "resource",
412418
"type": "object"
413419
},
@@ -428,6 +434,12 @@
428434
"markdownDescription": "忽略 `.gitignore` 中列举的文件。",
429435
"scope": "resource",
430436
"type": "boolean"
437+
},
438+
"Lua.zzzzzz.cat": {
439+
"default": false,
440+
"markdownDescription": "DONT TOUCH ME, LET ME SLEEP >_<",
441+
"scope": "resource",
442+
"type": "boolean"
431443
}
432444
},
433445
"title": "setting",

setting/schema.json

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@
3232
"scope": "resource",
3333
"type": "string"
3434
},
35+
"Lua.completion.displayContext": {
36+
"default": 6,
37+
"markdownDescription": "Previewing the relevant code snippet of the suggestion may help you understand the usage of the suggestion. The number set indicates the number of intercepted lines in the code fragment. If it is set to `0`, this feature can be disabled.",
38+
"scope": "resource",
39+
"type": "integer"
40+
},
3541
"Lua.completion.enable": {
3642
"default": true,
3743
"markdownDescription": "Enable completion.",
@@ -76,7 +82,7 @@
7682
"items": {
7783
"type": "string"
7884
},
79-
"markdownDescription": "Disabled diagnostic (Use code in hover brackets).\u000a```json\u000a\"Lua.diagnostics.disable\" : [\u000a \"unused-local\",\u000a \"lowercase-global\"\u000a]\u000a```\u000a",
85+
"markdownDescription": "Disabled diagnostic (Use code in hover brackets).\n```json\n\"Lua.diagnostics.disable\" : [\n \"unused-local\",\n \"lowercase-global\"\n]\n```\n",
8086
"scope": "resource",
8187
"type": "array"
8288
},
@@ -90,12 +96,12 @@
9096
"items": {
9197
"type": "string"
9298
},
93-
"markdownDescription": "Defined global variables.\u000a```json\u000a\"Lua.diagnostics.globals\" : [\u000a \"GLOBAL1\",\u000a \"GLOBAL2\"\u000a]\u000a```\u000a",
99+
"markdownDescription": "Defined global variables.\n```json\n\"Lua.diagnostics.globals\" : [\n \"GLOBAL1\",\n \"GLOBAL2\"\n]\n```\n",
94100
"scope": "resource",
95101
"type": "array"
96102
},
97103
"Lua.diagnostics.severity": {
98-
"markdownDescription": "Modified diagnostic severity.\u000a```json\u000a\"Lua.diagnostics.severity\" : {\u000a \"redefined-local\" : \"Warning\",\u000a \"emmy-lua\" : \"Hint\"\u000a}\u000a```\u000a",
104+
"markdownDescription": "Modified diagnostic severity.\n```json\n\"Lua.diagnostics.severity\" : {\n \"redefined-local\" : \"Warning\",\n \"emmy-lua\" : \"Hint\"\n}\n```\n",
99105
"properties": {
100106
"ambiguity-1": {
101107
"default": "Warning",
@@ -360,8 +366,8 @@
360366
"Lua.runtime.path": {
361367
"default": [
362368
"?.lua",
363-
"?\/init.lua",
364-
"?\/?.lua"
369+
"?/init.lua",
370+
"?/?.lua"
365371
],
366372
"items": {
367373
"type": "string"
@@ -396,7 +402,7 @@
396402
"items": {
397403
"type": "string"
398404
},
399-
"markdownDescription": "Ignored directories (Use `.gitignore` grammar).\u000a```json\u000a\"Lua.workspace.ignoreDir\" : [\u000a \"temp\/*.*\",\u000a \"!temp\/*.lua\"\u000a]\u000a```\u000a",
405+
"markdownDescription": "Ignored directories (Use `.gitignore` grammar).\n```json\n\"Lua.workspace.ignoreDir\" : [\n \"temp/*.*\",\n \"!temp/*.lua\"\n]\n```\n",
400406
"scope": "resource",
401407
"type": "array"
402408
},
@@ -407,7 +413,7 @@
407413
"type": "boolean"
408414
},
409415
"Lua.workspace.library": {
410-
"markdownDescription": "Load external library.\u000aThis feature can load external Lua files, which can be used for definition, automatic completion and other functions. Note that the language server does not monitor changes in external files and needs to restart if the external files are modified.\u000aThe following example shows loaded files in `C:\/lua` and `..\/lib` ,exclude `..\/lib\/temp`.\u000a```json\u000a\"Lua.workspace.library\": {\u000a \"C:\/lua\": true,\u000a \"..\/lib\": [\u000a \"temp\/*\"\u000a ]\u000a}\u000a```\u000a",
416+
"markdownDescription": "Load external library.\nThis feature can load external Lua files, which can be used for definition, automatic completion and other functions. Note that the language server does not monitor changes in external files and needs to restart if the external files are modified.\nThe following example shows loaded files in `C:/lua` and `../lib` ,exclude `../lib/temp`.\n```json\n\"Lua.workspace.library\": {\n \"C:/lua\": true,\n \"../lib\": [\n \"temp/*\"\n ]\n}\n```\n",
411417
"scope": "resource",
412418
"type": "object"
413419
},
@@ -428,6 +434,12 @@
428434
"markdownDescription": "Ignore files list in `.gitignore` .",
429435
"scope": "resource",
430436
"type": "boolean"
437+
},
438+
"Lua.zzzzzz.cat": {
439+
"default": false,
440+
"markdownDescription": "DONT TOUCH ME, LET ME SLEEP >_<",
441+
"scope": "resource",
442+
"type": "boolean"
431443
}
432444
},
433445
"title": "setting",

0 commit comments

Comments
 (0)