Open core-ai-bot opened 3 years ago
Comment by redmunds Wednesday Jan 11, 2017 at 20:55 GMT
Backtick (`) is not a valid string delimiter is JS. It should work if you use either single (') or double (") quotes instead.
Comment by sean0x72 Wednesday Jan 11, 2017 at 21:29 GMT
The first line of the function is using backticks and returns the next line. the problem appears to arise when using a place holder ${}; How is the backtick not valid?
Comment by redmunds Wednesday Jan 11, 2017 at 23:08 GMT
QuickEdit is implemented for JS. Whatever language you are using that uses backtick for string delimiters is not supported.
But, it looks like the ${}
placeholder you are using could also be used outside of a string, so my original suggestion doesn't fix all cases of the problem. That type of placeholder is also not supported (i.e. the closing brace is interpretted as the end of the function).
Comment by petetnt Thursday Jan 12, 2017 at 00:29 GMT
@
redmunds backticks (and ${expressions}
are used in templated literals and are valid string delimeters (in ES2015)
Comment by redmunds Thursday Jan 12, 2017 at 01:36 GMT
@
petetnt Thanks for clarifying. Either CodeMirror does not yet support ES2015, or Brackets is not recognizing the new tokens.
Comment by RaymondLim Thursday Jan 12, 2017 at 02:50 GMT
It is a bug in the regular expression that is used to extract functions in https://github.com/adobe/brackets/blob/master/src/language/JSUtils.js. It is mistakenly taking the closing brace inside the template literal as the closing brace of the function definition.
update: Actually, it is not the regexp that I originally thought. It is in _getFunctionEndOffset
where we're mistakenly identifying the }
in a template literal as the function end.
Issue by sean0x72 Wednesday Jan 11, 2017 at 20:10 GMT Originally opened as https://github.com/adobe/brackets/issues/13036
Qiuck edit does not display the entire funciton when using template literatles with embed expressions.
When using quick edit code is displayed like: