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

Index global variables #2656

Merged
merged 3 commits into from
Oct 4, 2024
Merged

Conversation

snutij
Copy link
Contributor

@snutij snutij commented Oct 2, 2024

Motivation

Iteration of #2644

Before providing features related to global variables, we must index them via RBS declarations, as we do for core constants for example.

Implementation

Handle RBS::AST::Declarations::Global in RBSIndexer, and create Entry::GlobalVariable for each declaration.

Automated Tests

I added a basic test, following index_methods example, but if specific assertions are required, I can add them.

Manual Tests

After indexation process, a search in the index with .prefix_search("$"), it should return all entries from RBS declaration.

@snutij snutij requested a review from a team as a code owner October 2, 2024 21:11
@snutij snutij requested review from st0012 and vinistock October 2, 2024 21:11
@andyw8 andyw8 added enhancement New feature or request server This pull request should be included in the server gem's release notes labels Oct 3, 2024
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.

Great!

lib/ruby_indexer/lib/ruby_indexer/entry.rb Outdated Show resolved Hide resolved
lib/ruby_indexer/lib/ruby_indexer/rbs_indexer.rb Outdated Show resolved Hide resolved
FreeMason9224

This comment was marked as spam.

Copy link
Member

@vinistock vinistock left a comment

Choose a reason for hiding this comment

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

Just a minor comment, but this looks great!

lib/ruby_indexer/lib/ruby_indexer/entry.rb Outdated Show resolved Hide resolved
Copy link
Member

@vinistock vinistock left a comment

Choose a reason for hiding this comment

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

Thank you for the contribution!

@vinistock vinistock enabled auto-merge (squash) October 4, 2024 19:42
@vinistock vinistock merged commit 9a737cb into Shopify:main Oct 4, 2024
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request 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.

4 participants