fix(parser): add support for .udt and .db file parsing and goto declaration

- extract_variables: Parse STRUCT fields in TYPE sections for .udt files
- extract_types: Handle quoted type names and multiple type definitions
- declaration handler: Extract quoted type names for goto declaration
- Add filetype detection for .udt and .db files in nvim config
This commit is contained in:
2026-02-20 08:59:54 +01:00
parent 9b393a65f0
commit 1f9c99272c
2 changed files with 95 additions and 46 deletions
+1 -1
View File
@@ -558,7 +558,7 @@ function handlers.textDocument_declaration(params)
local var_type = doc.variables[word].data_type
if var_type then
var_type = var_type:gsub("%s*;.*$", ""):gsub("%s*:=.*$", ""):gsub("^%s+", ""):gsub("%s+$", "")
local type_name = var_type:match("([%w_]+)")
local type_name = var_type:match('"([^"]+)"') or var_type:match("([%w_]+)")
if type_name and type_name ~= word then
table.insert(search_names, type_name)
end