-
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
Fix #15169, snippets not loading correctly #15171
Merged
smile13241324
merged 1 commit into
syl20bnr:develop
from
dalanicolai:fix-#15169-snippets-not-loading-correctly
Nov 20, 2021
Merged
Fix #15169, snippets not loading correctly #15171
smile13241324
merged 1 commit into
syl20bnr:develop
from
dalanicolai:fix-#15169-snippets-not-loading-correctly
Nov 20, 2021
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The auto-completion layer seems not to have been designed/configured correctly. So that, e.g., when using the julia layer, the `auto-completion/init-yasnippet` function is called after the `yasnippet-snippets` package has been loaded. Despite the ``yasnippet-snippets` package containing an `eval-after-load 'yasnippet`, the form within that block is, for some reason, evaluated already before `auto-completion/init-yasnippet` has been called. Anyway, what currently happens is that first `(yasnippet-snippets-initialize)` is evaluated, adding `yasnippet-snippets-dir` to the `yas-snippet-dirs` list. Then ``auto-completion/init-yasnippet` is called which contains the line `(setq yas-snippet-dirs nil)`, setting the list to nil again. As there is quite some logic involved (e.g. the order of evaluation is correct when the julia layer is not being used), this commit fixes the reported issue by simply calling `(yasnippet-snippets-initialize)` from `auto-completion/init-yasnippet` after the yas-snippet-dirs list has been resetted to nil. Any cleaner solution is welcome, but I would say this is a 'harmless' very pragmatic quick fix/solution.
dalanicolai
force-pushed
the
fix-#15169-snippets-not-loading-correctly
branch
from
November 20, 2021 16:14
7f098db
to
4da7e8c
Compare
smile13241324
approved these changes
Nov 20, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good quick fix, we can look into the details later.
thanhvg
added a commit
to thanhvg/spacemacs
that referenced
this pull request
Dec 28, 2021
…bnr#15169 This reverts commit f275553. This adds fix for julia layer breaking yasnippet set up. Commit f275553 fixed a specific bug in julia layer but it loads yasnippet and friends on start up which adds 1 sec to my startup time even though I don't use julia. Julia layer loads lsp-julia early on startup, which loads lsp who then loads yasnippet behind the scene unknown to spacemacs and use-package. That's why our nice and ordered setup for yasnippet and yasnippet-snippets failed as discused in syl20bnr#15171. We now tell use-package to defer its load.
thanhvg
added a commit
to thanhvg/spacemacs
that referenced
this pull request
Dec 28, 2021
…bnr#15169 This reverts commit f275553. This adds fix for julia layer breaking yasnippet set up. Commit f275553 fixed a specific bug in julia layer but it loads yasnippet and friends on start up which adds 1 sec to my startup time even though I don't use julia. Julia layer loads lsp-julia early on startup, which loads lsp who then loads yasnippet behind the scene unknown to spacemacs and use-package. That's why our nice and ordered setup for yasnippet and yasnippet-snippets failed as discused in syl20bnr#15171. We now tell use-package to defer its load.
thanhvg
added a commit
to thanhvg/spacemacs
that referenced
this pull request
Dec 28, 2021
…nr#15169 This reverts commit f275553. This adds fix for julia layer breaking yasnippet setup. Commit f275553 fixed a specific bug in julia layer but it loads yasnippet and friends on start up which adds 1 sec to my startup time even though I don't use julia. Julia layer loads lsp-julia early on startup, which loads lsp who then loads yasnippet behind the scene unknown to spacemacs and use-package. That's why our nice and ordered setup for yasnippet and yasnippet-snippets failed as discussed in syl20bnr#15171. We now tell use-package to defer its load.
smile13241324
pushed a commit
that referenced
this pull request
Dec 30, 2021
This reverts commit f275553. This adds fix for julia layer breaking yasnippet setup. Commit f275553 fixed a specific bug in julia layer but it loads yasnippet and friends on start up which adds 1 sec to my startup time even though I don't use julia. Julia layer loads lsp-julia early on startup, which loads lsp who then loads yasnippet behind the scene unknown to spacemacs and use-package. That's why our nice and ordered setup for yasnippet and yasnippet-snippets failed as discussed in #15171. We now tell use-package to defer its load.
thanhvg
added a commit
to thanhvg/spacemacs
that referenced
this pull request
Dec 31, 2021
…nr#15169 This reverts commit f275553. This adds fix for julia layer breaking yasnippet setup. Commit f275553 fixed a specific bug in julia layer but it loads yasnippet and friends on start up which adds 1 sec to my startup time even though I don't use julia. Julia layer loads lsp-julia early on startup, which loads lsp who then loads yasnippet behind the scene unknown to spacemacs and use-package. That's why our nice and ordered setup for yasnippet and yasnippet-snippets failed as discussed in syl20bnr#15171. We now tell use-package to defer its load.
eraad
pushed a commit
to datil/spacemacs
that referenced
this pull request
Jun 10, 2022
…nr#15169 This reverts commit f275553. This adds fix for julia layer breaking yasnippet setup. Commit f275553 fixed a specific bug in julia layer but it loads yasnippet and friends on start up which adds 1 sec to my startup time even though I don't use julia. Julia layer loads lsp-julia early on startup, which loads lsp who then loads yasnippet behind the scene unknown to spacemacs and use-package. That's why our nice and ordered setup for yasnippet and yasnippet-snippets failed as discussed in syl20bnr#15171. We now tell use-package to defer its load.
2ynn
pushed a commit
to 2ynn/spacemacs
that referenced
this pull request
Jun 22, 2022
…nr#15169 This reverts commit f275553. This adds fix for julia layer breaking yasnippet setup. Commit f275553 fixed a specific bug in julia layer but it loads yasnippet and friends on start up which adds 1 sec to my startup time even though I don't use julia. Julia layer loads lsp-julia early on startup, which loads lsp who then loads yasnippet behind the scene unknown to spacemacs and use-package. That's why our nice and ordered setup for yasnippet and yasnippet-snippets failed as discussed in syl20bnr#15171. We now tell use-package to defer its load.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The auto-completion layer seems not to have been designed/configured correctly.
So that, e.g., when using the julia layer, the
auto-completion/init-yasnippet
function is called after the
yasnippet-snippets
package has been loaded.Despite the
yasnippet-snippets
package containing aneval-after-load 'yasnippet
, the form within that block is, for some reason, evaluated alreadybefore
auto-completion/init-yasnippet
has been called.Anyway, what happens currently is that first
(yasnippet-snippets-initialize)
is evaluated, adding
yasnippet-snippets-dir
to theyas-snippet-dirs
list.Then
auto-completion/init-yasnippet
is called which contains the line(setq yas-snippet-dirs nil)
, setting the list to nil again.As there is quite some logic involved (e.g. the order of evaluation is correct
when the julia layer is not being used), this commit fixes the reported issue by
simply calling (again)
(yasnippet-snippets-initialize)
fromauto-completion/init-yasnippet
after the yas-snippet-dirs list has beenresetted to nil.
Any cleaner solution is welcome, but I would say this is a 'harmless' very
pragmatic quick fix/solution.