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

Add literal types to inferrer #2468

Merged
merged 2 commits into from
Aug 21, 2024
Merged

Add literal types to inferrer #2468

merged 2 commits into from
Aug 21, 2024

Conversation

vinistock
Copy link
Member

Motivation

This PR starts returning the expected type for literals, so that we can provide completion, go to definition, hover and signature help when something is invoked directly on one.

Implementation

I also fixed a minor bug that we had not caught. We were showing any type in the completion documentation as if it were a guessed type, but that should only appear if it was guessed.

Then I added a bunch of branches to cover literals.

Automated Tests

Added tests.

@vinistock vinistock added enhancement New feature or request server This pull request should be included in the server gem's release notes labels Aug 20, 2024
@vinistock vinistock self-assigned this Aug 20, 2024
@vinistock vinistock requested a review from a team as a code owner August 20, 2024 17:56
@vinistock vinistock requested review from andyw8 and st0012 August 20, 2024 17:56
@vinistock vinistock force-pushed the vs-add-literal-types branch from b2439e6 to 5855e79 Compare August 20, 2024 20:16
@andyw8
Copy link
Contributor

andyw8 commented Aug 21, 2024

Do we have a list of other literals not yet covered here? Range is the one I noticed, but there are probably others.

test/type_inferrer_test.rb Show resolved Hide resolved
@vinistock vinistock force-pushed the vs-add-literal-types branch from 5855e79 to d3892fe Compare August 21, 2024 18:45
@vinistock vinistock enabled auto-merge (squash) August 21, 2024 18:45
@vinistock vinistock merged commit 8e3dbfc into main Aug 21, 2024
34 checks passed
@vinistock vinistock deleted the vs-add-literal-types branch August 21, 2024 19:02
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.

3 participants