| Summary: | [es6] backtick strings should be shown using the string color | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [ECD] Orion | Reporter: | Olivier Thomann <Olivier_Thomann> | ||||||||||
| Component: | Editor | Assignee: | Grant Gayed <grant_gayed> | ||||||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||||||
| Severity: | normal | ||||||||||||
| Priority: | P3 | CC: | curtis.windatt.public, grant_gayed, Michael_Rennie | ||||||||||
| Version: | 11.0 | ||||||||||||
| Target Milestone: | 12.0 | ||||||||||||
| Hardware: | PC | ||||||||||||
| OS: | Windows 7 | ||||||||||||
| Whiteboard: | |||||||||||||
| Attachments: |
|
||||||||||||
|
Description
Olivier Thomann
Created attachment 261810 [details]
Proposed patch
Once the environment is restarted with that patch, the backtick strings are shown in blue (the default string color)
Created attachment 261811 [details]
Proposed patch
I forgot to update the copyrights
The single-line rule can just live in the javascript syntax.js rather than lib/syntax.js since it's not shared with any other languages. It looks like the multi-line rule has a problem (though I haven't tried the patch), as it still starts with a double quote rather than a backtick. Ok, I'll provide a fix for it. Created attachment 261812 [details]
The multiline string doesn't seem to work for single or double quotes either.
Should not we have the whole multi-line string in the string color?
(In reply to Olivier Thomann from comment #5) Yes, something's changed here, I've logged bug 493852. OK, I need more work there as the backtick strings can be multilined without using \. I'll see what that means for the regex pattern. For template literals (backtick strings), one thing to keep in mind while updating the syntax colouration, is that the string can contain expressions.
For example:
var a = 5;
var b = 10;
console.log(`Fifteen is ${a + b} and\nnot ${2 * a + b}.`);
so I would expect the stuff inside the ${} sections to be coloured as it would be outside of the template.
Created attachment 261828 [details]
Proposed patch
This patch would make backtick strings looking like other string literals for single line template. I don't think this is what Michael expects.
I didn't try to add multiline highlighting as it doesn't work for normal string literals.
Released, with string interpolation, commit: http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=6953343accfe2cfe01c54631174b1c7d5169ce9e . |