@@ -364,7 +364,7 @@ local function checkModule(state, word, position, results)
364364 if not locals [stemName ]
365365 and not vm .hasGlobalSets (state .uri , ' variable' , stemName )
366366 and not globals [stemName ]
367- and stemName :match ' ^[%a_][%w_]*$ '
367+ and stemName :match ( guide . namePatternFull )
368368 and matchKey (word , stemName ) then
369369 local targetState = files .getState (uri )
370370 if not targetState then
@@ -422,8 +422,11 @@ local function checkModule(state, word, position, results)
422422end
423423
424424local function checkFieldFromFieldToIndex (state , name , src , parent , word , startPos , position )
425- if name :match ' ^[%a_][%w_]*$' then
426- return nil
425+ if name :match (guide .namePatternFull ) then
426+ if not name :match ' [\x80 -\xff ]'
427+ or config .get (state .uri , ' Lua.runtime.unicodeName' ) then
428+ return nil
429+ end
427430 end
428431 local textEdit , additionalTextEdits
429432 local startOffset = guide .positionToOffset (state , startPos )
@@ -726,7 +729,7 @@ local function checkCommon(state, word, position, results)
726729 end
727730 end
728731 end
729- for str , offset in state .lua :gmatch ' ([%a_][%w_]+ )()' do
732+ for str , offset in state .lua :gmatch ( ' ( ' .. guide . namePattern .. ' )()' ) do
730733 if # results >= 100 then
731734 results .incomplete = true
732735 break
0 commit comments