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

[relay-lsp] Improve inline fragment suggestions for abstract types #4453

Conversation

tobias-tengler
Copy link
Contributor

@tobias-tengler tobias-tengler commented Sep 26, 2023

Previously the LSP would suggest the abstract type itself (why?) and either the members of a union or the object types implementing an interface when writing an inline fragment for an abstract type.

I've removed the suggestion of the abstract type itself and am instead including all the interfaces that are implemented by the object types that are primarily suggested. This is great for patterns like the Stage 6a mutation error pattern, where you have a union where each member implicitly implements a shared interface. With this change this shared interface would be suggested by the LSP as well, instead of just the concrete "errors".

@alunyov
Copy link
Contributor

alunyov commented Oct 5, 2023

I've removed the suggestion of the abstract type itself

Thanks! This is great!

@facebook-github-bot
Copy link
Contributor

@alunyov has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@alunyov has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@alunyov
Copy link
Contributor

alunyov commented Oct 6, 2023

@tobias-tengler I want to test this internally (per @captbaritone suggestion) we may have a long list of suggestions for interfaces like Node.

@facebook-github-bot
Copy link
Contributor

@alunyov merged this pull request in 5cadb43.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants