-
Notifications
You must be signed in to change notification settings - Fork 12.8k
annotateWithTypeFromJSDoc: Use changes.insertTypeAnnotation instead of replaceNode #22404
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,6 @@ verify.codeFix({ | |
newFileContent: | ||
`class C { | ||
/** @return {number} */ | ||
get c(): number { return 12; } | ||
get c(): number { return 12 } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why did we drop the semicolon? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There's no semicolon in the original (line 4 of this file). Previously we would reformat the body, but now we just add a type annotation. |
||
}`, | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For my own understanding, if
node
is not aHasType
but does have atype
property with a defined value, we will return that (as we did before?)?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the assumption is that only a
HasType
has a type.