Osmose / advanced-open-file

Open files and folders in Atom easily.
https://atom.io/packages/advanced-open-file
Other
118 stars 20 forks source link

./controller : Unexpected reserved word :-( #75

Closed seblegall closed 8 years ago

seblegall commented 8 years ago

Hi,

This package seems to be a good solution to replace my old-habit of emacs' ctrl-x-crtl-f. But it looks like error come when trying to find a file in a controlle directory... :-(

[Enter steps to reproduce below:]

  1. Open, for exemple, a Symfony2 Controller Class file
  2. Try to open a file using ctrl+alt+o

Atom Version: 1.0.4 System: Ubuntu 15.10 Thrown From: advanced-open-file package, v0.13.0

Stack Trace

Failed to activate the advanced-open-file package

At /home/slegall/.atom/packages/advanced-open-file/lib/advanced-open-file.js:2
import {AdvancedOpenFileController, emitter} from './controller';
^^^^^^
Unexpected reserved word

/home/slegall/.atom/packages/advanced-open-file/lib/advanced-open-file.js:2
import {AdvancedOpenFileController, emitter} from './controller';
^^^^^^
SyntaxError: Unexpected reserved word
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:435:25)
    at Object.loadFile [as .js] (/usr/share/atom/resources/app.asar/src/babel.js:163:21)
    at Module.load (module.js:347:32)
    at Function.Module._load (module.js:302:12)
    at Module.require (module.js:357:17)
    at require (module.js:376:17)
    at Package.module.exports.Package.requireMainModule (/usr/share/atom/resources/app.asar/src/package.js:759:34)
    at Package.module.exports.Package.activateConfig (/usr/share/atom/resources/app.asar/src/package.js:261:14)
    at Package.module.exports.Package.activateNow (/usr/share/atom/resources/app.asar/src/package.js:239:14)

Commands

     -0:01.0 advanced-open-file:toggle (atom-text-editor.editor.is-focused)

Config

{
  "core": {
    "audioBeep": false,
    "autoHideMenuBar": true
  }
}

Installed Packages

# User
advanced-open-file, v0.13.0
autoclose-html, v0.19.0
color-picker, v2.0.12
linter, v1.11.3
linter-js-standard, v3.2.1
linter-js-yaml, v1.2.4
linter-sass-lint, v0.4.1
minimap, v4.16.2
php-twig, v4.0.0
symfony-snippets, v0.3.0

# Dev
No dev packages
Osmose commented 8 years ago

Hi, thanks for the report!

You appear to be using an old Atom version, 1.0.4. Does upgrading Atom fix your problem?

My first guess is that the method we use to trigger compilation via Babel isn't supported in older versions of Atom. You used to have to add 'use babel'; at the top of files you wanted to be compiled, but now you use /** @babel */. I bet that change happened somewhere between 1.0.4 and the latest Atom.

seblegall commented 8 years ago

Ok. I'm using the default atom version in the official ubuntu 15.10 package repo.

Osmose commented 8 years ago

Sorry for the delay.

I have a branch up with a possible fix: https://github.com/Osmose/advanced-open-file/tree/old-atom-support

I can't figure out how to install an older version of Atom. Would you be willing/able to pull down that branch and test it on your older Atom to see if it works for you?

Osmose commented 8 years ago

I pushed out a fix updating the minimum Atom version so that others don't attempt to install this and run into the same issue, but I'm happy to merge the branch with the fix or find another fix if it doesn't work, I just need someone with an older version of Atom or good instructions on running an older version myself so that I can test it. :D