feat: add hover support for member access with comments

- Add member access chain resolution in hover handler
- Parse #var.member.submember notation and resolve type chain
- Show member comments in hover tooltip
- Extract comments from UDT and DB file fields
- Combine all type sources (doc.types, external_types, builtin)
This commit is contained in:
2026-02-21 00:13:52 +01:00
parent 5282385e79
commit 1606685a20
2 changed files with 163 additions and 0 deletions
+4
View File
@@ -212,9 +212,11 @@ local function parse_scl_type_file(content)
local field_name = line:match("^%s*(%w+)%s*:")
if field_name and field_name ~= "END_STRUCT" then
local field_type = line:match(":%s*([%w_]+)")
local field_comment = line:match("//%s*(.+)$") or line:match("%(%*(.-)%*%)")
table.insert(types[current_type_name].fields, {
name = field_name,
type = field_type or "unknown",
comment = field_comment,
})
end
end
@@ -254,10 +256,12 @@ local function parse_db_file(content)
local field_name = line:match("^%s*(%w+)%s*:")
if field_name then
local field_type = line:match(":%s*([%w_]+)")
local field_comment = line:match("//%s*(.+)$") or line:match("%(%*(.-)%*%)")
if field_type then
table.insert(types[current_type_name].fields, {
name = field_name,
type = field_type,
comment = field_comment,
})
end
end