@@ -645,14 +645,11 @@ local function checkCommon(state, word, position, results)
645645 for _ , data in ipairs (keyWordMap ) do
646646 used [data [1 ]] = true
647647 end
648- if not config .get (state .uri , ' Lua.completion.workspaceWord' )
649- or # word >= 2 then
650- results .complete = true
651- end
652648 if config .get (state .uri , ' Lua.completion.workspaceWord' ) and # word >= 2 then
653649 local myHead = word :sub (1 , 2 )
654650 for uri in files .eachFile () do
655651 if # results >= 100 then
652+ results .incomplete = true
656653 break
657654 end
658655 if myUri == uri then
@@ -702,6 +699,7 @@ local function checkCommon(state, word, position, results)
702699 end
703700 for str , offset in state .lua :gmatch ' ([%a_][%w_]+)()' do
704701 if # results >= 100 then
702+ results .incomplete = true
705703 break
706704 end
707705 if # str >= 3
@@ -716,9 +714,6 @@ local function checkCommon(state, word, position, results)
716714 end
717715 end
718716 end
719- if # results >= 100 then
720- results .complete = false
721- end
722717end
723718
724719local function checkKeyWord (state , start , position , word , hasSpace , afterLocal , results )
@@ -1973,7 +1968,7 @@ end
19731968
19741969--- @async
19751970local function completion (uri , position , triggerCharacter )
1976- local state = files .getState (uri )
1971+ local state = files .getLastState ( uri ) or files . getState (uri )
19771972 if not state then
19781973 return nil
19791974 end
0 commit comments