Eclipse代码抄袭 [英] Eclipse code fomatting

查看:133
本文介绍了Eclipse代码抄袭的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些twig文件是JavaScript,HTML和twig标记的混合物。有没有一种方法可以使用Eclipse来代替一段代码,并将其格式化为JavaScript,然后再添加另一个部分并将其格式化为HTML?我尝试使用JavaScript编辑器将文件类型* .twig关联起来,但是我似乎没有任何格式化。语法突出显示和代码完成也很好。



谢谢,
Scott

解决方案

这是可能的。如果您有HTML / JS编辑器可用(默认情况下是eclipse classic)。


  1. 转到首选项:常规>编辑器>文件关联,然后添加 *。twig 作为新文件类型,然后添加HTML编辑器(在底部面板中)。

  2. 然后转到:常规>内容类型,单击文本/ HTML节点(内容类型框),并在底部面板中添加 *。twig 文件关联。

我已经检查过,它的工作原理。


I have some twig files that are a mixture of JavaScript, HTML, and twig markup. Is there a way with Eclipse to hi-lite a section of code and format it as, say JavaScript, then hi-lite another section and format it as HTML? I tried association the file type *.twig with the JavaScript editor, but, I do not seem to get any formatting. Syntax highlighting and code completion would be good too.

Thanks, Scott

解决方案

It is possible. If you have HTML/JS editors available (eclipse classic has them by default).

  1. Go to preferences and: General > Editors > File Associations and add *.twig as a new file type and then add HTML editor (in the bottom panel) to it.
  2. Then go to: General > Content Types, click on Text/HTML node (in Content Types box) and add *.twig file association in the bottom panel.

I've checked this and it works.

这篇关于Eclipse代码抄袭的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆