简体   繁体   English

Aptana Javascript模板

[英]Aptana Javascript templates

I'd like to set my Eclipse to use javascript templates with Aptana Studio. 我想将Eclipse设置为在Aptana Studio中使用javascript模板。 I've set a new template here: window/preferences/aptana/editors/javascript/templates. 我在这里设置了一个新模板:window / preferences / aptana / editors / javascript / templates。

The template's description: name: ccc, context: javascript, description: own comment, pattern: // -- 模板的描述:名称:ccc,上下文:javascript,描述:自己的注释,模式://-

I open .js files with aptana JS editor and the perspective is Aptana Web. 我使用aptana JS编辑器打开.js文件,透视图是Aptana Web。 When I type "ccc" and push ctrl + shift I don't get any suggestion or insertion. 当我键入“ ccc”并按ctrl + shift时,我不会得到任何建议或插入。 When I type "c" I can find my template in the suggestion list and choose it, but it's cumbersome. 当我输入“ c”时,我可以在建议列表中找到我的模板并选择它,但这很麻烦。

Why can I find the template in the suggestion list with one character and why Aptana doesn't insert or even find my template with 3 character? 为什么我可以在建议列表中找到一个字符的模板,为什么Aptana无法插入甚至找不到三个字符的模板?

I'have been using simple java templates in this way without any problem. 我一直在以这种方式使用简单的Java模板,没有任何问题。

It's a flaw in the Studio 2 template selection logic. 这是Studio 2模板选择逻辑中的一个缺陷。 Studio 2 adopts a selection/filtering mechanism closer to Visual Studio than Eclipse where it selects the most appropriate option from the popup rather than filtering the list down to only matching elements. Studio 2采用的选择/过滤机制比Eclipse更接近Visual Studio,在Eclipse中,它从弹出窗口中选择最合适的选项,而不是仅将列表过滤为仅匹配的元素。

However, the snippets come from a different process than the regular proposals, and Aptana does the selection process independent of the templates, so the template will never be automatically picked as an appropriate option. 但是,这些摘录来自与常规提议不同的过程,并且Aptana的选择过程与模板无关,因此永远不会自动选择模板作为适当的选项。

It may not be the optimal solution for you, but Studio 3 adopts a different mechanism for doing snippets/templates and they will behave as you expect: 对于您来说,这可能不是最佳解决方案,但是Studio 3采用了不同的机制来制作摘录/模板,它们的行为将与您期望的一样:

http://wiki.appcelerator.org/display/tis/Creating+a+new+snippet http://wiki.appcelerator.org/display/tis/Creating+a+new+snippet

Otherwise, I might suggest adding a ticket in the Aptana Studio Lighthouse tracker: https://aptana.lighthouseapp.com/projects/35272-studio/overview 否则,我建议您在Aptana Studio Lighthouse跟踪器中添加票证: https : //aptana.lighthouseapp.com/projects/35272-studio/overview

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM