From 1863d0e3e2e8ae488b69817212ea00549ae06204 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= <sumneko@hotmail.com>
Date: Thu, 6 Jan 2022 20:31:39 +0800
Subject: [PATCH] completion can triggered in LuaDoc and string

---
 package.json                 | 23 ++++++++++++++++++++++-
 package/package.lua          |  7 ++++++-
 syntaxes/lua.tmLanguage.json | 14 ++++++++++++--
 3 files changed, 40 insertions(+), 4 deletions(-)

diff --git a/package.json b/package.json
index cbe64c3..816388e 100644
--- a/package.json
+++ b/package.json
@@ -1082,6 +1082,22 @@
                     "scope": "resource",
                     "type": "integer"
                 },
+                "Lua.hint.arrayIndex": {
+                    "default": "Auto",
+                    "enum": [
+                        "Enable",
+                        "Auto",
+                        "Disable"
+                    ],
+                    "markdownDescription": "%config.hint.arrayIndex%",
+                    "markdownEnumDescriptions": [
+                        "%config.hint.arrayIndex.Enable%",
+                        "%config.hint.arrayIndex.Auto%",
+                        "%config.hint.arrayIndex.Disable%"
+                    ],
+                    "scope": "resource",
+                    "type": "string"
+                },
                 "Lua.hint.enable": {
                     "default": false,
                     "markdownDescription": "%config.hint.enable%",
@@ -1510,7 +1526,12 @@
             {
                 "language": "lua",
                 "path": "./syntaxes/lua.tmLanguage.json",
-                "scopeName": "source.lua"
+                "scopeName": "source.lua",
+                "tokenTypes": {
+                    "comment.line.double-dash.doc.lua": "other",
+                    "string.quoted.double.lua": "other",
+                    "string.quoted.single.lua": "other"
+                }
             }
         ],
         "semanticTokenScopes": [
diff --git a/package/package.lua b/package/package.lua
index 5eca485..f5390e4 100644
--- a/package/package.lua
+++ b/package/package.lua
@@ -39,7 +39,12 @@ return {
             {
                 language = "lua",
                 scopeName = "source.lua",
-                path = "./syntaxes/lua.tmLanguage.json"
+                path = "./syntaxes/lua.tmLanguage.json",
+                tokenTypes = {
+                    ["comment.line.double-dash.doc.lua"] = "other",
+                    ["string.quoted.single.lua"]         = "other",
+                    ["string.quoted.double.lua"]         = "other",
+                },
             }
         },
         semanticTokenScopes = {
diff --git a/syntaxes/lua.tmLanguage.json b/syntaxes/lua.tmLanguage.json
index 535264d..01cdf0b 100644
--- a/syntaxes/lua.tmLanguage.json
+++ b/syntaxes/lua.tmLanguage.json
@@ -364,19 +364,29 @@
 							"name": "comment.line.double-dash.lua"
 						},
 						{
-							"begin": "---?",
+							"begin": "---",
 							"beginCaptures": {
 								"0": {
 									"name": "punctuation.definition.comment.lua"
 								}
 							},
 							"end": "\\n",
-							"name": "comment.line.double-dash.lua",
+							"name": "comment.line.double-dash.doc.lua",
 							"patterns": [
 								{
 									"include": "#luadoc"
 								}
 							]
+						},
+						{
+							"begin": "--",
+							"beginCaptures": {
+								"0": {
+									"name": "punctuation.definition.comment.lua"
+								}
+							},
+							"end": "\\n",
+							"name": "comment.line.double-dash.lua"
 						}
 					]
 				},
-- 
GitLab