From 484f993c6a1026b7eb04d48ff4aee00e2dcafd54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Tue, 13 Jun 2023 21:00:02 +0800 Subject: completion for quoted fields fix #2088 --- script/core/hover/label.lua | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'script/core') diff --git a/script/core/hover/label.lua b/script/core/hover/label.lua index 6ce4dde9..62e51927 100644 --- a/script/core/hover/label.lua +++ b/script/core/hover/label.lua @@ -134,7 +134,7 @@ local function asField(source) end local function asDocFieldName(source) - local name = source.field[1] + local name = vm.viewKey(source, guide.getUri(source)) or '?' local class for _, doc in ipairs(source.bindGroup) do if doc.type == 'doc.class' then @@ -143,10 +143,12 @@ local function asDocFieldName(source) end end local view = vm.getInfer(source.extends):view(guide.getUri(source)) - if not class then - return ('(field) ?.%s: %s'):format(name, view) + local className = class and class.class[1] or '?' + if name:match(guide.namePatternFull) then + return ('(field) %s.%s: %s'):format(className, name, view) + else + return ('(field) %s%s: %s'):format(className, name, view) end - return ('(field) %s.%s: %s'):format(class.class[1], name, view) end local function asString(source) -- cgit v1.2.3