Skip to content
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

Import dosen't works anymore :'( #16

Open
t1gu1 opened this issue May 8, 2017 · 3 comments
Open

Import dosen't works anymore :'( #16

t1gu1 opened this issue May 8, 2017 · 3 comments

Comments

@t1gu1
Copy link

t1gu1 commented May 8, 2017

There are the errors i've in Atom:
image

I'm on Linux: Ubuntu
I need this magic plugin works on Atom.
I was on phpStorm be Atom is really nice but this plugin is price less.

Thx for your works.
I swear to see it fix in a moment. :)

@trotzig
Copy link
Contributor

trotzig commented May 9, 2017

I'm glad you like the tool!

Import-js should work without having watchman installed, although you'll have a much more pleasant experience when it is available. Here are installation instructions: https://facebook.github.io/watchman/docs/install.html (it needs to be installed globally).

If you for some reason can't use watchman (or if the issue remains after watchman installation), I need a little more input from you:

  • what symptoms are you seeing? Does anything get imported? Are you seeing other messages when you try importing?
  • Did import-js tell you anything about needing some time to initialize on first import? It takes a while to fill the cache/indexed storage.

@t1gu1
Copy link
Author

t1gu1 commented May 16, 2017

Hi, thanks for the response.

I just have an error like this one on the fix all imports function :
SyntaxError: Unexpected token (30:12)

The line(30:12):
new SubscribeRoute (app);

It should import this:
import {SubscribeRoute} from './routes/subscribe';

When i use the function import word under cursor it works!!
But it import this import { SubscribeRoute } from '../../../dist/server/core/routes/subscribe';
but it should be this:
import {SubscribeRoute} from './routes/subscribe';

I think i know the issue.. i'm working in typescript.ts
In fact it's not an issue but an enchancement.
It'll be very nice if it works with typescript files!! :O

Seriously, if you can pimp your code/plugin or create an other one for .ts file.
You'll create a big missing thing of Atom!

@trotzig
Copy link
Contributor

trotzig commented May 16, 2017

At the moment, import-js doesn't have any support for typescript. To enable it, there are a few things we need to do:

A) Change file watching to find *.ts files as well
B) use a typescript parser in order to find exports

A is probably pretty easy. B could be easy as well, but I don't know much about the typescript parser, and how it differs from babylon (that we use currently).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants