diff --git a/src/diagnostics.lua b/src/diagnostics.lua index 5d0c466..87dbc65 100644 --- a/src/diagnostics.lua +++ b/src/diagnostics.lua @@ -218,8 +218,13 @@ function M.validate_diagnostics(content, workspace_types, root_dir) if type_part:match("%s+OF%s+") then base_type = type_part:match('.*%s+OF%s+"([^"]+)"') or type_part:match(".*%s+OF%s+([%w_]+)") end + + local is_array_keyword = base_type and base_type:upper() == "ARRAY" + and type_part:match("^[Aa][Rr][Rr][Aa][Yy]%[") + local upper_type = base_type and base_type:upper() or nil if base_type and base_type ~= "" and + not is_array_keyword and not all_types[base_type] and not builtin.is_known_data_type(upper_type) and not builtin.is_known_type_or_instruction(upper_type) then