atom / snippets

Atom snippets package
MIT License
205 stars 100 forks source link

Builtin snippets are not working when the snippets package is loaded from a V8 snapshot #243

Closed segevfiner closed 6 years ago

segevfiner commented 6 years ago

Prerequisites

Description

When the snippets package is loaded from a V8 snapshot, I think __dirname doesn't point to the correct directory and this code: lib/snippets.coffee:80-85, fails to find the correct path to the bundled snippets.{cson,json}.

Might have to pull off something like this atom/github/lib/helpers.js:7-21 for this to work. Though someone might want to refactor so as to reuse the logic rather than copy it at some point.

This is particularly jarring since it is mentioned right there in the default snippets.cson and in Atom Flight Manual – Snippets.

Note that it does work in dev mode which skips the V8 snapshot

Steps to Reproduce

  1. Open your snippets.cson in your .atom.
  2. Type snip<tab>

Expected behavior: The builtin "snip" snippet is expanded.

Actual behavior: It's not expanded.

Reproduces how often: 100%

Versions

Windows 10.0.15063 x64

Atom    : 1.20.1
Electron: 1.6.9
Chrome  : 56.0.2924.87
Node    : 7.4.0

apm  1.18.4
npm  3.10.10
node 6.9.5 x64
python 2.7.14
git 2.14.1.windows.1
visual studio 2015