Skip to content

rubocop-yard: Add support for multiple & nested Hash keys definition#1630

Merged
lsegal merged 7 commits into
lsegal:mainfrom
lekemula:add-string-symbol-literal-code-objects
May 25, 2026
Merged

rubocop-yard: Add support for multiple & nested Hash keys definition#1630
lsegal merged 7 commits into
lsegal:mainfrom
lekemula:add-string-symbol-literal-code-objects

Conversation

@lekemula

@lekemula lekemula commented Sep 28, 2025

Copy link
Copy Markdown
Contributor

Description

Follow-up on #1628 (omit first 2 commits when reviewing)

Adds support for multiple and nested hash keys - example from specs:

"Hash{:key_one, :key_two => String; :key_three => Symbol; :key_four => Hash{:sub_key_one => String}}" => "a Hash with keys made of (a literal value :key_one or a literal value :key_two) and values of (Strings) and keys made of (a literal value :key_three) and values of (Symbols) and keys made of (a literal value :key_four) and values of (a Hash with keys made of (a literal value :sub_key_one) and values of (Strings))",
"Hash{:key_one => String, Number; :key_two => String}" => "a Hash with keys made of (a literal value :key_one) and values of (Strings or Numbers) and keys made of (a literal value :key_two) and values of (Strings)"

NOTE: These changes probably only impact on https://github.com/ksss/rubocop-yard and have no effect elsewhere.

PS. I think this alongside the base PR, will open up a lot of opportunities for better Hash completion/typechecking for solargraph gem.

Completed Tasks

  • I have read the Contributing Guide.
  • The pull request is complete (implemented / written).
  • Git commits have been cleaned up (squash WIP / revert commits).
  • I wrote tests and ran bundle exec rake locally (if code is attached to PR).

@lekemula lekemula force-pushed the add-string-symbol-literal-code-objects branch from b0f014c to ddddd34 Compare September 28, 2025 14:55
@lekemula lekemula changed the title Add support for multiple & nested Hash keys definition rubocop-yard: Add support for multiple & nested Hash keys definition Sep 28, 2025
@lekemula lekemula marked this pull request as ready for review September 28, 2025 14:58
@lsegal

lsegal commented Dec 5, 2025

Copy link
Copy Markdown
Owner

FYI: this change is hard to review with #1628 merged in here.

@lekemula lekemula force-pushed the add-string-symbol-literal-code-objects branch from ddddd34 to 0491ab4 Compare February 17, 2026 08:10
@lekemula lekemula force-pushed the add-string-symbol-literal-code-objects branch 2 times, most recently from 98cce23 to bcf20c9 Compare February 24, 2026 21:59
@lekemula

Copy link
Copy Markdown
Contributor Author

FYI: this change is hard to review with #1628 merged in here.

@lsegal I wish I could point the base to my branch, but otherwise the diff is basically this commit: bcf20c9

@lsegal

lsegal commented Apr 16, 2026

Copy link
Copy Markdown
Owner

See comment in #1628 -- this needs a rebase

lekemula and others added 3 commits May 12, 2026 21:17
- Add LITERALMATCH regex constant to match symbol (:symbol) and string ('string', "string") literals
- Update TypesExplainer parser to recognize symbol and string literal types
- Format literal values as "a literal value :symbol" for better readability
- Add comprehensive test coverage for LITERALMATCH constant and literal type parsing
- Fixes parsing inconsistency between YARD TypesExplainer and online parser

Resolves lsegal#1627

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This could be useful for solargraph gem
@lekemula lekemula force-pushed the add-string-symbol-literal-code-objects branch from bcf20c9 to 70604a3 Compare May 12, 2026 19:27
@lekemula lekemula force-pushed the add-string-symbol-literal-code-objects branch from 70604a3 to d6232f4 Compare May 12, 2026 19:40
@lekemula

Copy link
Copy Markdown
Contributor Author

Hi @lsegal, I rebased my changes, so this PR is ready for re-review 🙏

@lsegal lsegal merged commit d29a77c into lsegal:main May 25, 2026
25 checks passed
@lsegal

lsegal commented May 25, 2026

Copy link
Copy Markdown
Owner

This is great, thank you for the contributions!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants