开发者

Aptana Javascript templates

开发者 https://www.devze.com 2023-01-03 13:13 出处:网络
I\'d like to set my Eclipse to use javascript templates with Aptana Studio. I\'ve set a new template here: window/preferences/aptana/editors/javascript/templates.

I'd like to set my Eclipse to use javascript templates with Aptana Studio. I've set a new template here: window/preferences/aptana/editors/javascript/templates.

The template's description: name: ccc, context: javascript, description: own comment, pattern: // --

I open .js files with aptana JS editor and the perspective is Aptana Web. When I type "ccc" and push ctrl + shift I don't get any suggestion or insertion. When I type "c" I can find my template in the suggestion list and choose it, but it's cumbersome.

W开发者_运维技巧hy 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?

I'have been using simple java templates in this way without any problem.


It's a flaw in the Studio 2 template selection logic. 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.

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.

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:

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

0

精彩评论

暂无评论...
验证码 换一张
取 消