-
-
Notifications
You must be signed in to change notification settings - Fork 594
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
Use typescript info for interpolation completion #1446
Conversation
6dfb0b8
to
271dbfc
Compare
I would love to see that feature! Could we get a small update about it, please? 😄 |
Still need to fix the empty completion case |
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.
Those are the only things I'm not haapy about. Other than that this seems good so I'm merging.
@@ -35,7 +35,7 @@ export default { | |||
* My count | |||
*/ | |||
count () { | |||
return this.$store.state.count | |||
return 42; |
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.
I had to change this because otherwise the typing would be wrong and cause the whole this
to have any type...
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.
It's probably because of the return type annotation problem... 😢
https://vuejs.org/v2/guide/typescript.html#Annotating-Return-Types
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.
JSDocs return type doesn't work either. Sad..
@@ -26,7 +26,7 @@ export default { | |||
}, | |||
computed: { | |||
count () { | |||
return this.$store.state.count | |||
return 42; |
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.
I had to change this because otherwise the typing would be wrong and cause the whole this
to have any type...
fix #1129
To use
ts.LanguageService#getCompletionsAtPosition
to get completion list for interpolation expression. It also combines previous completion info so that the behavior should be backward compatible.There is a known issue when an interpolation expression is invalid. Our source map cannot handle expression position, then provides wrong completion in that case. We need to think how we handle invalid expression in the future.-> Fixed via #1448