Skip to content

Commit 4e92d39

Browse files
committed
Add the tag name to the comments
1 parent 6d194f9 commit 4e92d39

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

lib/ruby_lsp/phlex/addon.rb

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,16 @@ def on_call_node_enter(node)
3131
return unless :register_element == name
3232

3333
case arguments
34-
in [Prism::SymbolNode[unescaped: String => element_name], *]
35-
@listener.add_method(element_name, location, [
34+
in [Prism::SymbolNode[unescaped: String => method_name], *]
35+
tag_name = method_name.tr("_", "-")
36+
arguments[1] in Prism::StringNode[unescaped: String => tag_name]
37+
38+
@listener.add_method(method_name, location, [
3639
RubyIndexer::Entry::Signature.new([
3740
RubyIndexer::Entry::KeywordRestParameter.new(name: :attributes),
3841
RubyIndexer::Entry::BlockParameter.new(name: :content),
3942
]),
40-
], visibility: :public)
43+
], visibility: :public, comments: "Outputs a `<#{tag_name}>` tag.")
4144
end
4245
end
4346
end

0 commit comments

Comments
 (0)