jQuery icon indicating copy to clipboard operation
jQuery copied to clipboard

autocomplete of ajax command doubles $-indicator

Open stackem opened this issue 11 years ago • 4 comments

When I type

jQuery.ajax or $.ajax

and then select the first normal ajax function, the following appears:

$.$.ajax({ ... or jQuery.$.ajax({ ...

It helps to have a good function build but you always have to remove the leading doubled indicator. It maybe is the case with other functions too, but am using the ajax request quite often so it's quite annoying.

Best, Robin

stackem avatar Mar 25 '14 18:03 stackem

Hi @stackem, your issue actually applies to all jQuery. methods (jQuery.ajax(), jQuery.map() etc) so I would have to change it for all of them. Do you think that is a good idea?

mrmartineau avatar Dec 11 '14 11:12 mrmartineau

yeah I think that would be a good change

stackem avatar Dec 11 '14 11:12 stackem

Hi I'm trying to solve this problem here https://github.com/gaboesquivel/jQuery/tree/new-triggers

I've reorganized the snippets in the following directories: ├── Completion_Snippets -----> these will not include $. or jQuery. ├── Dollar_Snippets -----> these ones will include $. ├── Plugin_Snippets ----> snippets for building plugins ├── jQuery_Snippets -----> these will include jQuery.

for dollar snippets I'm using j_ prefix and for jQuery snippets J_ . Sublime snippet triggers are caseSensitive. for completion snippets I'm not sure if we need to use .triggerString ( includes the dot ) or simply the function name as trigger.

For all them ideally we will get the list of options while typing and we need to properly describe that this is jQuery autocomplete in description.

let me know your ideas.

also what are Support and Syntaxes for?

gaboesquivel avatar Feb 03 '15 23:02 gaboesquivel

Old issue, but one that has been bothering me only more recently.

I've implemented a "fix/hack" that's working for me.

My main issue was the snippet for $('') producing a double-$.

I edited the tabTrigger to be a double-$ and it works to produce a single $ instead. Sublime has even learned that when I use a single $ + tab it triggers this snippet accurately.

Edited snippet:

<snippet>
	<content><![CDATA[\$('${1:string/element/array/function/jQuery object/string, context}')$0]]></content>
	<tabTrigger>$$</tabTrigger>
	<description>$('#select DOM Element')</description>
	<scope>source.js</scope>
</snippet>

paulmist avatar Dec 21 '22 10:12 paulmist