@@ -607,15 +607,16 @@ local function checkCommon(ast, word, text, offset, results)
607
607
if not cache .commonWords then
608
608
cache .commonWords = {}
609
609
local mark = {}
610
- for str in files .getText (uri ):gmatch ' ([%a_][%w_]* )' do
610
+ for str in files .getText (uri ):gmatch ' ([%a_][%w_]+ )' do
611
611
if not mark [str ] then
612
612
mark [str ] = true
613
613
cache .commonWords [# cache .commonWords + 1 ] = str
614
614
end
615
615
end
616
616
end
617
617
for _ , str in ipairs (cache .commonWords ) do
618
- if not used [str ]
618
+ if # str >= 3
619
+ and not used [str ]
619
620
and (str ~= word or not files .eq (myUri , uri )) then
620
621
used [str ] = true
621
622
if matchKey (word , str ) then
@@ -630,7 +631,7 @@ local function checkCommon(ast, word, text, offset, results)
630
631
for uri in files .eachDll () do
631
632
local words = files .getDllWords (uri ) or {}
632
633
for _ , str in ipairs (words ) do
633
- if not used [str ] and str ~= word then
634
+ if # str >= 3 and not used [str ] and str ~= word then
634
635
used [str ] = true
635
636
if matchKey (word , str ) then
636
637
results [# results + 1 ] = {
@@ -642,8 +643,8 @@ local function checkCommon(ast, word, text, offset, results)
642
643
end
643
644
end
644
645
else
645
- for str , pos in text :gmatch ' ([%a_][%w_]* )()' do
646
- if not used [str ] and pos - 1 ~= offset then
646
+ for str , pos in text :gmatch ' ([%a_][%w_]+ )()' do
647
+ if # str >= 3 and not used [str ] and pos - 1 ~= offset then
647
648
used [str ] = true
648
649
if matchKey (word , str ) then
649
650
results [# results + 1 ] = {
0 commit comments