summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcarsakiller <carsakiller@gmail.com>2024-05-23 06:11:46 +0000
committercarsakiller <carsakiller@gmail.com>2024-05-23 06:11:46 +0000
commitb9c9f9423ff31bb9160acc5d75feaec3c0bf777c (patch)
tree26c7d6e008f669b7a4ecdbd6a900a017a4931e6d
parent1f3a500b81ad1d55cf8564de9eca590e9f29e80b (diff)
downloadlua-language-server-b9c9f9423ff31bb9160acc5d75feaec3c0bf777c.zip
fix: greedy match
-rw-r--r--script/core/completion/completion.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/script/core/completion/completion.lua b/script/core/completion/completion.lua
index cf2ec745..dc045474 100644
--- a/script/core/completion/completion.lua
+++ b/script/core/completion/completion.lua
@@ -2268,7 +2268,7 @@ local function trySymbolReference(state, position, results)
-- User will ask for completion at end of symbol name so we need to perform a reverse match to see if they are in a symbol reference
-- Matching in reverse allows the symbol to be of any length and we can still match all the way back to `](lua://` from right to left
- local symbol = string.match(string.reverse(line), "%)?(.*)//:aul%(%]", #line - col)
+ local symbol = string.match(string.reverse(line), "%)?([%w%s-_.*]*)//:aul%(%]", #line - col)
if symbol then
-- flip it back the right way around