以前我写过的这样的东西:
这里是崇高的版本https://github.com/Microsoft/TypeScript-Sublime-Plugin/pull/189/files
如何为Atom写同一件事?
在我的系统上形成atom typescript插件:
/Users/amin/.atom/packages/atom-typescript/grammars/ts.cson
https://gist.github.com/aminroosta/509476f48f05f4b56db2c0748fedc8fd
这对于角度2开发非常有用,
这里是一个截图为atom与HTML和CSS的亮点:
我找不到更好的正则表达式来匹配模板:和样式:[如果有人可以想出一个更好的正则表达式,我会接受他们的答案.
ts.cson文件中的重要变化是:
"template-HTML": name: "Meta.template.HTML.ts" begin: "`<!---->" beginCaptures: "0": name: "string.quoted.template.ts" end:"`" endCaptures: "0": name: "string.quoted.template.ts" patterns: [ { include: "text.HTML.basic" } ]"template-CSS": name: "Meta.template.CSS.ts" begin: "`/\*\*/" beginCaptures: "0": name: "string.quoted.template.ts" end:"`" endCaptures: "0": name: "string.quoted.template.ts" patterns: [ { include: "source.CSS" } ]
更新:
找到一个解决方案:
"template-HTML": name: "Meta.template.HTML.ts" begin: "(?<=template\:)\s*`" beginCaptures: "0": name: "string.quoted.template.ts" end:"`" endCaptures: "0": name: "string.quoted.template.ts" patterns: [ { include: "text.HTML.basic" } ]"template-CSS": name: "Meta.template.CSS.ts" begin: "(?<=styles\:)\s*(\[)\s*(`)" beginCaptures: "2": name: "string.quoted.template.ts" end:"`" endCaptures: "0": name: "string.quoted.template.ts" patterns: [ { include: "source.CSS" } ]
这是更新的截图:
总结以上是内存溢出为你收集整理的模板文字中的Atom HTML语法高亮(对于angular2)全部内容,希望文章能够帮你解决模板文字中的Atom HTML语法高亮(对于angular2)所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)