Skip to content
This repository has been archived by the owner on May 20, 2020. It is now read-only.

Implement snippet name overlap checker system #284

Open
GaurangTandon opened this issue Jun 19, 2019 · 9 comments
Open

Implement snippet name overlap checker system #284

GaurangTandon opened this issue Jun 19, 2019 · 9 comments
Milestone

Comments

@GaurangTandon
Copy link
Owner

GaurangTandon commented Jun 19, 2019

  • recently, snippet delimiters caused havoc among people who had overlapping snippet names, thereby causing many support emails. basically, the snippet delimiters were reset, so people's snippets like sign and gsign overlapped, resulting in always only sign working.
  • even then, some people use snippets like REPORT CAC and CAC, so in that case they cannot expand the first one as space is one of the default delimiters (@#$%&*+-=(){}[]:"'/_<>?!., ).

However, removing snippet name delimiters in favor of matching longest snippet name first is not a good idea, because people do have snippets like s and ds and it really makes typing literally any other word that contains s or ds impossible.

However, people have little to no acquaintance with the snippet name delimiter list, as is shown by their thoughts on the support email, so expecting them to go ahead and modify the snippet name delimiter list to suit their needs is a bad idea.

Hence, solution is to implement an overlap checker feature. Every time the options page loads, it would check all snippets for overlap, and report its findings to the user in a nice dialog box. It would suggest two things: rename the snippet or remove that offending delimiter from the list. Also, it would prevent future creation of overlapping snippets.

Need to come up with some UI for that. I want it to be a non-intrusive yellow box at the bottom of the snippet list, with a corresponding warning arrow at the top ("you have unchecked warnings, scroll below")

@GaurangTandon GaurangTandon added this to the 3.6.1 milestone Jun 19, 2019
@GaurangTandon
Copy link
Owner Author

I will consider doing this after the 3.6.0 update

@lee-tts
Copy link
Contributor

lee-tts commented Jun 24, 2019

First—love the extension, thank you!

I have this exact issue. I had a large number of snippets that 'overlap' and after a recent update, I only get the shortest snippet. For example I have both tts and ts, prv and rv, etc., but cannot access the longer snippet because the extension now expands the shorter snippet.

What is the design intention here? I'm happy to go along with your best practices but it's not clear from your options or what you wrote above how you imagine this will work best :)

Thanks again!

Lee

Edit: Ok it looks like deleting all 'snippet delimiters' restores the original functionality.

@GaurangTandon
Copy link
Owner Author

GaurangTandon commented Jun 24, 2019

Right, so, actually, this feature should have been there before the last upgrade was pushed rather now as an after-thought. Although I never really touched snipNameDelimiters, so I am not sure why so many people had this setting reset. In any case, now that the problem is there, this feature is necessary to correct it :)

@lee-tts
Copy link
Contributor

lee-tts commented Jun 24, 2019

You got a lot of support requests because the functionality changed :) The only way to get the behavior I had before is to turn on the delimiters and then delete them all from the list.

I'm not sure I understand your point "makes typing literally any other word that contains s or ds impossible" — surely it's only a problem if you trigger the extension?

@GaurangTandon
Copy link
Owner Author

GaurangTandon commented Jun 24, 2019

You got a lot of support requests because the functionality changed :)

Yah right. I even put this in the v3.5.2 change log box but many people don't read it :(

I had before is to turn on the delimiters and then delete them all from the list.

Why would you turn on the delimiters and then delete them all from the list? Isn't that situation the same as not having delimiters at all? (i.e. delimiter setting set to off)

surely it's only a problem if you trigger the extension?

I agree, but many people keep very simple hotkeys (like just space). This results in avoiding such overlaps very important.

@lee-tts
Copy link
Contributor

lee-tts commented Jun 24, 2019

Why would you turn on the delimiters and then delete them all from the list? Isn't that situation the same as not having delimiters at all? (i.e. delimiter setting set to off)

On my system (Chromium, Ubuntu) if I keep delimiters off, I cannot use snippets if they adjoin another word (ex. I cannot trigger snippets that do not require a space before them, ex. — em dash). If I turn delimiters on, I cannot use a snippet if there is a shorter one (ex. tts will not work if I have ts). If I turn delimiters on and clear all default characters, then I get the behavior I want.

I agree, but many people keep very simple hotkeys (like just space). This results in avoiding such overlaps very important.

That is hardcore! :D

@GaurangTandon
Copy link
Owner Author

GaurangTandon commented Jun 24, 2019

Alright, that is definitely some unexpected behavior. Could you please give an exact example of a snippet name and the word before it? Right now, when I turn off delimiters, and try to expand "youbrb", I get back "yoube right back" (here brb was actually my snippet name, it was adjoining a normal word "you") I think that is expected, isn't it?

@lee-tts
Copy link
Contributor

lee-tts commented Jun 24, 2019

I'm very sorry, it seems I was not saving the delimiter list properly. Now when I clear the list and save, no snippets work. I'm not sure why I was seeing the behavior I want before.

I think I will roll back to an earlier version and disable extension updates. It will be simpler for you, since it seems my use case is unusual (?)

@GaurangTandon
Copy link
Owner Author

GaurangTandon commented Jun 24, 2019

Please don't. Newer versions have lots of upgrades and I would not recommend downgrading. Please send me an example of what you believe is expected behavior, and I will try understand it. Also, the comments got too long, so let us continue this discussion on email ([email protected]).

(Also, you can only get old versions from the /releases page in unpackaged form and sync storage doesn't work for unpackaged extensions.)

@GaurangTandon GaurangTandon modified the milestones: 3.6.2, 3.7.0 Jun 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants