Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid directly calling version to avoid Sorbet error #2663

Merged
merged 1 commit into from
Oct 3, 2024
Merged

Conversation

st0012
Copy link
Member

@st0012 st0012 commented Oct 3, 2024

Motivation

This will avoid breaking add-ons that don't define a version method and doesn't require ruby-lsp as a dependency when displaying the add-ons in the UI.

Implementation

Checks if the version method's owner if Addon. If it is, calling it would cause Sorbet to raise error so we avoid it. But if it's not, we call it to get the version.

Automated Tests

Updated existing test to cover both cases (defined and not defined).

Manual Tests

This will avoid breaking add-ons that don't define a `version` method and
doesn't require `ruby-lsp` as a dependency when displaying the add-ons in the UI.
@st0012 st0012 added bugfix This PR will fix an existing bug server This pull request should be included in the server gem's release notes labels Oct 3, 2024
@st0012 st0012 requested a review from a team as a code owner October 3, 2024 15:37
@st0012 st0012 merged commit 791cd00 into main Oct 3, 2024
35 checks passed
@st0012 st0012 deleted the followup-on-2662 branch October 3, 2024 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix This PR will fix an existing bug server This pull request should be included in the server gem's release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants