Skip to content

spacemacs/helm-yas(SPC i s) breaks the # condition: system of YASnippet #14105 #21

@nfedyashev

Description

@nfedyashev

Description :octocat:

Something must be wrong with helm-yas because it ignores(or caches?) the results for autocompletion. # condition: is unusable with helm-yas

Reproduction guide 🪲

Create the following snippet:
1.

cat enh-ruby-mode/big-number
# -*- mode: snippet -*-
# name: ruby big number digit readable human
# condition: (= (line-number-at-pos) 1)
# --
100_000_000_000
  1. Open any .rb file or just switch to ruby-mode/enh-ruby-mode.
  2. Navigate to any line that is not the first one and execute SPC i s(spacemacs/helm-yas)
  3. Start typing e.g. "number"

Observed behaviour: 👀 💔
"ruby big number digit readable human` is listed in autocompletion mode(condition is ignored)

Expected behaviour: ❤️ 😄
"ruby big number digit readable human" snippet name must be available in auto-completion only on the first line(when a condition is true)

This issue is only reproducible in helm-yas. When I run yas-insert-snippet command instead it works fine! # condition: is properly checked and only the matching snippets are displayed.

System info

yasnippet pkg info 20200604.246
helm-c-yasnippet pkg info 20200520.1519
Spacemacs branch - develop

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions