-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Auto-completion always load snippets shipped by default #7092
Comments
I disagree that this is a bug. The most intuitive behaviour is that the private snippets supplant the base set, not replace them entirely. If you don't want the base set it's simple enough to remove it in your config already.
Why would this be desired? |
I don't think people who want their snippets customized are likely to continue to use the base set. For example, it's difficult to modify an existing snippet. I can't modify the file lying in the original directory, or it could possibly be overwritten by package updates. The only way to make it DWIM, is copy the existing snippets into the private snippet directory, and remove the base directory from Copy all the base snippets to the private directory, and adjust the variable by hand. It's too much for such a simple task. I believe that all users of Spacemacs are power users, and of course they'd like to tweak their snippets to fit their own coding style and achieving more efficiency. The behavior that I proposed takes consider of all scenarios:
|
You could copy the existing snippet into the private directory, modify it, and not remove the base directory. Since the private directory comes first in yas-snippet-dirs, your modified snippet will be chosen. There's no need to explicitly remove the base set just because you want to change some of them. The only reason you'd want to do that is if you explicitly want fewer snippets, but I (being not a snippet power user) have never in my life felt that the snippets intrude on my coding, so I don't recognize that being an issue. All your hypothetical users are well served by the current system, as far as I can see.
should be satisfied with the current system.
should be satisfied by the current system. (I just did exactly this. It works.)
should be satisfied by the current system (by definition). |
The default snippet set contains multiple snippets that binds to the same key. For example, both
This is not the only reason I guess. More importantly, the behavior of current setting is not consistent. Let me explain:
I really don't think the current behavior is desirable. |
For consistent behavior, what about the following method? Ignore the basic snippets when private snippets are detected. On modification to basic snippets or creating new snippets, all snippets are copied to private directory immediately. If you just use the basic set, everything works fine and snippets are automatically synchronized with elpa. |
It has been 9 months since the last update. I've found my own way to work around long ago. Should any user confuse about the behavior, I'd recommend ignoring what Spacemacs layers do for you, and configure (setq yas-snippet-dirs '("~/.emacs.d/private/snippets")) After reviewing the whole thread, I think it's time to archive this issue. However, closing the issue doesn't imply my satisfaction towards the current settings. When many people use the software, maintaining backward compatibility is a burdensome must somehow. It's difficult to come up with a solution that takes care of all users. In conclusion, let's get over with it, and move on! |
Description
Auto-completion layer always loads the snippet shipped by yasnippet. See packages.el:237
The desired behavior is:
private-yas-dir
(set by variableauto-completion-private-snippets-directory
or generated fromconfiguration-layer-private-directory
) is found in file system,yas-installed-snippets-dir
should be ignored.auto-completion-enable-snippets-shipped-by-default
is set,yas-installed-snippets-dir
will be used regardless of whetherprivate-yas-dir
is detected.Pro:
Con:
Reproduction guide
elpa/yasnippet-xxx/snippet
is seen in the listRelevant config
System Info
The text was updated successfully, but these errors were encountered: