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

Make document generic #2436

Merged
merged 2 commits into from
Aug 15, 2024
Merged

Make document generic #2436

merged 2 commits into from
Aug 15, 2024

Conversation

vinistock
Copy link
Member

Motivation

This is the final step for separating document concerns. In order to support other document types like RBS, we need to ensure that the base Document class is generic and accounts for different types of @parse_result.

Implementation

This PR:

  • Makes Document generic
  • Fixes the type of the parse result in ERBDocument and RubyDocument
  • Starts returning early from requests depending on document types, since we now need to properly narrow types to satisfy type checking
  • Moves locate outside of the parent Document since the implementation is Ruby specific (but also used in ERBDocument)

It's a rather large PR, but the changes are all interdependent and I couldn't split it into smaller chunks.

Automated Tests

Existing tests cover the refactor.

@vinistock vinistock added server This pull request should be included in the server gem's release notes other Changes that aren't bugfixes, enhancements or breaking changes labels Aug 13, 2024
@vinistock vinistock self-assigned this Aug 13, 2024
@vinistock vinistock requested a review from a team as a code owner August 13, 2024 15:14
@vinistock vinistock requested review from andyw8 and st0012 August 13, 2024 15:14
Base automatically changed from vs-continue-document-concern-separation to main August 13, 2024 19:03
@vinistock vinistock force-pushed the vs-make-document-generic branch from 760779f to d879724 Compare August 13, 2024 20:11
Copy link
Contributor

@andyw8 andyw8 left a comment

Choose a reason for hiding this comment

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

🎆

@vinistock vinistock merged commit af60237 into main Aug 15, 2024
35 checks passed
@vinistock vinistock deleted the vs-make-document-generic branch August 15, 2024 19:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
other Changes that aren't bugfixes, enhancements or breaking changes 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