Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

autocomplete of ajax command doubles $-indicator #11

Open
stackem opened this issue Mar 25, 2014 · 4 comments
Open

autocomplete of ajax command doubles $-indicator #11

stackem opened this issue Mar 25, 2014 · 4 comments

Comments

@stackem
Copy link

stackem commented Mar 25, 2014

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

@mrmartineau
Copy link

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?

@stackem
Copy link
Author

stackem commented Dec 11, 2014

yeah I think that would be a good change

@gaboesquivel
Copy link

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?

@paulmist
Copy link

paulmist commented Dec 21, 2022

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>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants