-
Notifications
You must be signed in to change notification settings - Fork 418
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
fix(core): fix autocomplete for defineType
in VSCode
#6447
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
|
ricokahler
changed the title
Feat/enable auto complete for type
fix(core): fix autocomplete for Apr 22, 2024
defineType
in VSCode
ricokahler
force-pushed
the
feat/enable-auto-complete-for-type
branch
from
April 22, 2024 20:47
351e424
to
3d20da2
Compare
ricokahler
force-pushed
the
feat/enable-auto-complete-for-type
branch
from
April 22, 2024 20:51
3d20da2
to
0333907
Compare
ricokahler
force-pushed
the
feat/enable-auto-complete-for-type
branch
from
April 22, 2024 20:52
0333907
to
4205ef7
Compare
No changes to documentation |
Component Testing Report Updated Apr 22, 2024 9:01 PM (UTC)
|
binoy14
approved these changes
Apr 22, 2024
jordanl17
pushed a commit
that referenced
this pull request
Apr 23, 2024
* feat(core): improve defineType TType * fix: add tsdoc comment; add to `defineField` and `defineArrayMember` --------- Co-authored-by: Gregor Gabrič <gregor.gabric@outlook.com>
cngonzalez
pushed a commit
that referenced
this pull request
May 8, 2024
* feat(core): improve defineType TType * fix: add tsdoc comment; add to `defineField` and `defineArrayMember` --------- Co-authored-by: Gregor Gabrič <gregor.gabric@outlook.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Supersedes #6426 by @GregorGabric. Include the original commit by @GregorGabric.
This pull request introduces a small but crucial change to the typing of the
defineType
function to improve the autocomplete experience in VSCode.The original implementation used a type parameter that extended
string | IntrinsicTypeName
, which caused VSCode's autocomplete to not effectively prioritize or sometimes display the specific string literals defined underIntrinsicTypeName
. This was due to the broad nature of thestring
type overwhelming the specific suggestions thatIntrinsicTypeName
could provide.By introducing an intersection type
AllowOtherStrings = string & {}
, we differentiate the generic string type from our specific string type (IntrinsicTypeName
). This subtle change encourages TypeScript's type inference system to handle these types distinctly, thereby improving the relevance and prioritization of autocomplete suggestions in VSCode.What to review
Does the change make sense? Does it affect more than it should?
Testing
Notes for release
Improves autocomplete in VSCode for
defineType
anddefineField
with more relevant suggestions. Thanks @GregorGabric!