summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSewbacca <sebastian.kalus@kolabnow.com>2022-11-18 17:58:47 +0100
committerSewbacca <sebastian.kalus@kolabnow.com>2022-11-18 17:58:47 +0100
commit832784a3f5f9c48921ce9c9f9d6fc4e3f4376d04 (patch)
tree9dd802b82ca8d256c5544ead7724a49c51f9bba1
parent1b44530283a7388eb56faa0ad3f5e9262b205149 (diff)
downloadlua-language-server-832784a3f5f9c48921ce9c9f9d6fc4e3f4376d04.zip
Allow auto completion for complex dir structures
-rw-r--r--script/core/completion/completion.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/script/core/completion/completion.lua b/script/core/completion/completion.lua
index 64a7899a..29bd06ca 100644
--- a/script/core/completion/completion.lua
+++ b/script/core/completion/completion.lua
@@ -369,10 +369,11 @@ local function checkModule(state, word, position, results)
for _, sr in ipairs(infos) do
local pattern = sr.searcher
:gsub("(%p)", "%%%1")
- :gsub("%%%?", "([%%a_][%%w_]*)")
+ :gsub("%%%?", "(.-)")
local stemName = relativePath
:match(pattern)
+ :match("[%a_][%w_]*$")
if not stemName or testedStem[stemName] then
goto INNER_CONTINUE
@@ -382,7 +383,6 @@ local function checkModule(state, word, position, results)
if not locals[stemName]
and not vm.hasGlobalSets(state.uri, 'variable', stemName)
and not globals[stemName]
- and stemName:match '^[%a_][%w_]*$'
and matchKey(word, stemName) then
local targetState = files.getState(uri)
if not targetState then