From 26d201a6da14f0c3d38fac3ea5388c54fdebd9af Mon Sep 17 00:00:00 2001 From: Joel Drapper Date: Wed, 2 Oct 2024 15:16:21 +0100 Subject: [PATCH] Improve LSP hints (#796) Better LSP support for standard elements --- lib/phlex/html/standard_elements.rb | 935 +++++++++++++++++++++------- lib/phlex/html/void_elements.rb | 93 ++- 2 files changed, 797 insertions(+), 231 deletions(-) diff --git a/lib/phlex/html/standard_elements.rb b/lib/phlex/html/standard_elements.rb index 69f60bae..c267a9a6 100644 --- a/lib/phlex/html/standard_elements.rb +++ b/lib/phlex/html/standard_elements.rb @@ -5,517 +5,1034 @@ module Phlex::HTML::StandardElements extend Phlex::SGML::Elements # Outputs an `` tag. + # The `` element creates a hyperlink to web pages, files, email addresses, locations in the same page, or anything else a URL can address. # See https://developer.mozilla.org/docs/Web/HTML/Element/a - def a(id: nil, class: nil, href: nil, target: nil, **attributes, &content) = nil - register_element :a, tag: "a" + register_element def a( + class: nil, + href: nil, + id: nil, + rel: nil, + target: nil, + title: nil, + **attributes, + &content + ) = nil # Outputs an `` tag. + # The `` element represents an abbreviation or acronym. # See https://developer.mozilla.org/docs/Web/HTML/Element/abbr - def abbr(id: nil, class: nil, **attributes, &content) = nil - register_element :abbr + register_element def abbr( + class: nil, + id: nil, + title: nil, + **attributes, + &content + ) = nil # Outputs an `
` tag. + # The `
` element indicates contact information for a person or organization. # See https://developer.mozilla.org/docs/Web/HTML/Element/address - def address(id: nil, class: nil, **attributes, &content) = nil - register_element :address + register_element def address( + class: nil, + id: nil, + **attributes, + &content + ) = nil # Outputs an `
` tag. + # The `
` element represents a self-contained composition in a document, page, application, or site. # See https://developer.mozilla.org/docs/Web/HTML/Element/article - def article(id: nil, class: nil, **attributes, &content) = nil - register_element :article + register_element def article( + class: nil, + id: nil, + **attributes, + &content + ) = nil # Outputs an `