moll / vim-node

Tools and environment to make Vim superb for developing with Node.js. Like Rails.vim for Node.
http://www.vim.org/scripts/script.php?script_id=4674
Other
807 stars 59 forks source link

Add alternate extensions for node files #17

Closed danielfalk closed 9 years ago

danielfalk commented 9 years ago

This adds some extensions that can be used for es6 modules: (es, es6) as well as react components (jsx)

moll commented 9 years ago

Hey!

Super suggestion! Thanks! Would you mind adding tests too akin to the ones it should already have? If not, let me know and I'll do so myself before merging.

Cheers

moll commented 9 years ago

It's been a while since I last hacked this. Wasn't suffixesadd for opening files without typing the suffix in? I'm not 100% sure it's the right thing to edit to get Node.vim initialized for those other types. If that was what you were after. Anywho that's what automated tests are for. To answer those questions. ^_^

danielfalk commented 9 years ago

I'm not all that familiar with ruby, but I tried to follow your lead. I'm also not sure if they pass, since I'm not quite sure how to run the suite?

I updated the pull request.

moll commented 9 years ago

Thanks!

You should be able to run the tests with make test after running bundle install.

Are you using some require extension in Node.js too? I'm thinking Node itself won't be able to find .es files otherwise, right?

danielfalk commented 9 years ago

Yes, I am currently using babel (a.k.a., 6to5) to extend require. There is also node-jsx which does a similar thing.

I figured out how to install bundle, and ran bundle install, which worked ok. But when I run make test, I see this:

/usr/lib/ruby/gems/2.2.0/gems/ansi-1.4.3/lib/ansi/chart.rb:26: warning: duplicated key at line 29 ignored: :concealed
/home/dan/.bundler/ruby/2.2.0/vimrunner-4b1ee072e52d/lib/vimrunner/platform.rb:25:in `vim': No suitable Vim executable could be found for this system. (Vimrunner::NoSuitableVimError)
    from /home/dan/.bundler/ruby/2.2.0/vimrunner-4b1ee072e52d/lib/vimrunner/server.rb:37:in `block in initialize'
    from /home/dan/.bundler/ruby/2.2.0/vimrunner-4b1ee072e52d/lib/vimrunner/server.rb:37:in `fetch'
    from /home/dan/.bundler/ruby/2.2.0/vimrunner-4b1ee072e52d/lib/vimrunner/server.rb:37:in `initialize'
    from /home/dan/checkouts/dotfiles/vim/bundle/vim-node/test/helper.rb:15:in `new'
    from /home/dan/checkouts/dotfiles/vim/bundle/vim-node/test/helper.rb:15:in `<top (required)>'
    from /home/dan/checkouts/dotfiles/vim/bundle/vim-node/test/autoload/lib_test.rb:1:in `require_relative'
    from /home/dan/checkouts/dotfiles/vim/bundle/vim-node/test/autoload/lib_test.rb:1:in `<top (required)>'
    from -e:1:in `require'
Makefile:14: recipe for target 'spec' failed
make: *** [spec] Error 1

But vim is in my path. if I run which vim, I get: /usr/bin/vim.

danielfalk commented 9 years ago

Hmm. Never could figure out how to run the tests, but Travis CI ran the tests in the pull request and it appears they passed :-) So it should be good to go, right? Or are there other tests you'd like to see?

moll commented 9 years ago

Sorry for having you spend time on testing when it turned out suffixesadd fulfilled the need for now. Thank you again for caring!