Skip to content

Conversation

@apiology
Copy link
Contributor

@apiology apiology commented Aug 4, 2025

Description

This matches behavior of https://yardoc.org/types. Literal symbols are also supported by RBS, sord and recent versions of Solargraph, so this also reduces interoperability friction between tools.

For instance, valid Solargraph annotations will cause errors in rubocop-yard, which uses YARD for parsing:

  lib/solargraph/complex_type/unique_type.rb:200:27: C: YARD/TagTypeSyntax: (SyntaxError) invalid character at :

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).

This matches behavior of https://yardoc.org/types. Literal symbols are
also supported by RBS, sord and recent versions of Solargraph, so this
also reduces interoperability friction between tools.
Comment on lines 60 to 63
# Regular expression to match an identifier like a variable or method name
IDENTIFIERMATCH = %r{[a-zA-Z_]\w*[!?=]?|[-+~]\@|<<|>>|=~|===?|![=~]?|<=>|[<>]=?|\*\*|[-/+%^&*~`|]|\[\]=?}

METHODNAMEMATCH = IDENTIFIERMATCH
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This changes documentation (unnecessarily). I would just use METHODNAMEMATCH in types_explainer.

Copy link
Owner

@lsegal lsegal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

small nit in comment above

@apiology
Copy link
Contributor Author

apiology commented Dec 7, 2025

small nit in comment above

Fixed

@apiology apiology requested a review from lsegal December 7, 2025 15:22
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