alohaas / language-nunjucks

Syntax highlighting for nunjucks templates in atom.
MIT License
42 stars 13 forks source link

Snippets #18

Closed zenopopovici closed 8 years ago

zenopopovici commented 8 years ago

Hi,

The call snippet is overwritting the html class autocomplete. Whenever I want to type in class="", i end up activating the call snippet. It drives me crazy.

Can't we have an option to disable the snippets?

Thanks

puranjayjain commented 8 years ago

@zenopopovici we can change that to some other keyword for triggering. Any good suggestions?

zenopopovici commented 8 years ago

How about get?

alohaas commented 8 years ago

@zenopopovici thanks for opening this issue! I think get is a fair suggestion for a replacement keyword trigger, but I would guess that most people would still be expecting call to trigger it. I'm worried about the user experience if we implement that solution.

@puranjayjain and @zenopopovici do either of you know whether we can make the snippet declaration more explicit? I would rather have the call snippet activate once someone types ca rather than immediately when they type c. Using ReGex?

An alternative method may be to allow the html autocomplete to take precedence over the nunjucks autocomplete...I don't know if this is a configurable thing in Atom or not...

Please share your thoughts on the alternatives and I'll look into whether they are possible. Otherwise, we can go with get.

zenopopovici commented 8 years ago

@alohaas I don't know ... thing is right now the current experience is unbearable. You always need to write class. I created myself a snippet that replaces call with class so I can work..

alohaas commented 8 years ago

@zenopopovici well the fact that you describe it as unbearable is a good enough testimony for me to go with get for now 👍

zenopopovici commented 8 years ago

@alohaas Thanks a lot :D

alohaas commented 8 years ago

@zenopopovici what is the name of the html autocomplete package you use that is causing conflicts? I'd like to install it so I can test.

zenopopovici commented 8 years ago

@alohaas It's the default in Atom. I use class way more than I use call, whenever I write in c or cl I get call instead of class. When you're writting HTML everyday in the same way there is a muscle memory and you hit enter after the first or second character. This is happening to all 3 of us here in our office. It's not just me.

Your plugin is changing the usual behaviour of Atom's HTML autocomplete. Yes, I could write cla and I would get class but the muscle memory is just too strong to change that consciously. So you get call a lot of times instead of class. It's a UX thing, not a bug and it's very disruptive.

Hope I made myself understood.

Zeno.

puranjayjain commented 8 years ago

@zenopopovici true it becomes a headache for me too. @alohaas there must be a way for html to take precedence although someone sometime earlier suggested to me that we could import another grammar in our grammar for that matter. I'll ask around for examples. But this would be a long term solution for a short term one I guess we can change it to some other name.

alohaas commented 8 years ago

@zenopopovici apologies for the confusion! I was typing class without any html element and wondering why it wasn't auto-completing. I was able to replicate what you're experiencing once I wrote some actual html.

@puranjayjain I'd rather keep the complexity low so I'm going to implement get for now 👌