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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user