-
Notifications
You must be signed in to change notification settings - Fork 392
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 string interpolation autocomplete and location #748
Fix string interpolation autocomplete and location #748
Conversation
One thing I want to test first is that something like |
@@ -2706,14 +2728,18 @@ AstExpr* Parser::parseInterpString() | |||
break; | |||
case Lexeme::BrokenInterpDoubleBrace: | |||
nextLexeme(); | |||
return reportExprError(location, {}, ERROR_INVALID_INTERP_DOUBLE_BRACE); | |||
return reportExprError(endLocation, {}, ERROR_INVALID_INTERP_DOUBLE_BRACE); |
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.
nit: note for some future clean-up PR, constant should have been a static const char* kErrorInvalidInterpDoubleBrace = ;
instead of a define
.
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 whatever reason, that didn't work when I tried it.
https://github.com/Roblox/luau/pull/614/files#r931152226
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.
Another work-around would be reportExprError(endLocation, {}, "%s", kErrorInvalidInterpDoubleBrace);
but doesn't matter any more.
Should be ready for merge 🙂 |
String interpolation autocomplete was not working and was just using default autocomplete. This fixes it so that inside a string it is treated as normal, and inside an expression it suggests expression level autocomplete.
Also fixes the range, which was previously just the first lexeme.