-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
Suggestion: string interpolation #13
Comments
I'm interested in working on this. I had a local fork for the 0.9 compiler that included parser changes to allow With the new compiler work underway, what's the best way for an external contributor to help out here? |
Thanks @duncanmak, a PR would be a good way to share your proposal with us. Since this is a bigger change than normal bug fixes, I would suggest sharing your changes early so that you can get feedback as you go. Feel free to tag me, or email me directly if you have any questions. Please follow the guidelines in CONTRIBUTING.md and submit a Contributor License Agreement (CLA) before submitting the pull request. |
👍 Codeplex issue : https://typescript.codeplex.com/workitem/19 |
This would be great to have in TypeScript 👍 |
+1: A highly desirable enhancement. |
Unless I'm missing something, codegen for < ES6 should be just a case of removing the line-end character(s) and correctly escaping single and double-quote. |
It would be especially nice if this were to support type annotations which could be determined in the lexer. So you could annotate a string as containing HTML which editors could use to provide highlighting, autocomplete etc. Or better yet, something similar to Nemerle's macros (see: http://nemerle.org/About). |
As a heads up, I'm currently taking this on. |
Implemented in #960 and #1072. There are still some details being ironed out, but we support tagged templates on ES6 emit and untagged templates on all emit targets. Type-checking occurs in substitution expressions, however, in an untagged template expression, there is no constraint on the type of the substitution expressions. In a tagged template, overload resolution may occur, yielding an appropriate signature. Substitution expressions are constrained by the signature's parameters' types. A synthesized value of the new Language service support for signature help on tagged templates is in the works on #1204. |
Hey Daniel, |
Thanks, great work guys! On Wednesday, February 11, 2015, Daniel Rosenwasser <
|
So we have string interpolation, and support for tagged templates coming up in 1.5 - these are great features, but has anyone thought about adding support for an alternative file extension for template files? Basically just Typescript, but with the contents of the file being emitted or returned somehow, and you have to use a tag to escape from output - I guess basically EJS for Typescript. There are lots of fine template engines for JS, but what I'm after is something that will receive the same excellent IDE support Typescript gets - I haven't found anything like that for JS. (we're a rather large team considering a transition from PHP towards Typescript+Node, and a key missing feature right now is views/templates with proper IDE support, e.g. auto-complete for a view-model and view helper-functions.) |
@mindplay-dk I suspect this might just happen with angular support followed by angular support for server side next year. |
Support ES6-style template strings
http://tc39wiki.calculist.org/es6/template-strings/
To be determined: Can we generate code for pre-ES6 targets? What does that look like?
The text was updated successfully, but these errors were encountered: