Skip to content

Commit 06cad0c

Browse files
authored
Merge pull request #2488 from fesily/Never-sematic-virtual-ast-and-comment
Never sematic virtual ast and comment
2 parents 34319c7 + 21da40b commit 06cad0c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

script/core/semantic-tokens.lua

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -882,6 +882,10 @@ return function (uri, start, finish)
882882

883883
local n = 0
884884
guide.eachSourceBetween(state.ast, start, finish, function (source) ---@async
885+
-- skip virtual source
886+
if source.virtual then
887+
return
888+
end
885889
Care(source.type, source, options, results)
886890
n = n + 1
887891
if n % 100 == 0 then
@@ -890,6 +894,10 @@ return function (uri, start, finish)
890894
end)
891895

892896
for _, comm in ipairs(state.comms) do
897+
-- skip virtual comment
898+
if comm.virtual then
899+
return
900+
end
893901
if start <= comm.start and comm.finish <= finish then
894902
local headPos = (comm.type == 'comment.short' and comm.text:match '^%-%s*[@|]()')
895903
or (comm.type == 'comment.long' and comm.text:match '^@()')

0 commit comments

Comments
 (0)