diff options
-rw-r--r-- | server/src/core/hover/hover.lua | 4 | ||||
-rw-r--r-- | server/src/parser/ast.lua | 4 | ||||
-rw-r--r-- | server/src/parser/grammar.lua | 2 | ||||
-rw-r--r-- | server/test/diagnostics/init.lua | 2 | ||||
-rw-r--r-- | server/test/hover/init.lua | 4 |
5 files changed, 9 insertions, 7 deletions
diff --git a/server/src/core/hover/hover.lua b/server/src/core/hover/hover.lua index d78b8add..dbbafc30 100644 --- a/server/src/core/hover/hover.lua +++ b/server/src/core/hover/hover.lua @@ -208,13 +208,15 @@ local function getValueHover(source, name, value, lib) local loc = source:bindLocal() if loc.tags then local mark = {} + local tagBufs = {} for _, tag in ipairs(loc.tags) do local tagName = tag[1] if not mark[tagName] then mark[tagName] = true - tp = ('%s <%s>'):format(tp, tagName) + tagBufs[#tagBufs+1] = ('<%s>'):format(tagName) end end + name = name .. ' ' .. table.concat(tagBufs, ' ') end tips[#tips+1] = loc:getComment() elseif source:get 'global' then diff --git a/server/src/parser/ast.lua b/server/src/parser/ast.lua index 0be0027d..a67a16cb 100644 --- a/server/src/parser/ast.lua +++ b/server/src/parser/ast.lua @@ -974,7 +974,7 @@ local Defs = { version = State.Version, } } - elseif tag[1] ~= 'const' and tag[1] ~= 'toclose' then + elseif tag[1] ~= 'const' and tag[1] ~= 'close' then pushError { type = 'UNKNOWN_TAG', start = tag.start, @@ -996,7 +996,7 @@ local Defs = { end return tags end, - LocalName = function (tags, name) + LocalName = function (name, tags) name.tags = tags return name end, diff --git a/server/src/parser/grammar.lua b/server/src/parser/grammar.lua index aa44a3ce..5183803b 100644 --- a/server/src/parser/grammar.lua +++ b/server/src/parser/grammar.lua @@ -500,7 +500,7 @@ Set <- (SimpleList AssignOrEQ ExpList?) LocalNameList <- (LocalName (COMMA LocalName)*) -> List -LocalName <- (LocalTag MustName) +LocalName <- (MustName LocalTag) -> LocalName Call <- Simple diff --git a/server/test/diagnostics/init.lua b/server/test/diagnostics/init.lua index 36cfb3c6..5d015dfd 100644 --- a/server/test/diagnostics/init.lua +++ b/server/test/diagnostics/init.lua @@ -444,7 +444,7 @@ TEST [[ ]] TEST [[ -local <const> x = 1 +local x <const> = 1 <!x!> = 2 return x ]] diff --git a/server/test/hover/init.lua b/server/test/hover/init.lua index cafbdc99..a3d56cdf 100644 --- a/server/test/hover/init.lua +++ b/server/test/hover/init.lua @@ -817,10 +817,10 @@ local x: any ]] TEST [[ -local <toclose> <const> <?x?> = 1 +local <?x?> <close> <const> = 1 ]] [[ -local <toclose> <const> x: number = 1 +local x <close> <const>: number = 1 ]] TEST [[ |