atom-import-js icon indicating copy to clipboard operation
atom-import-js copied to clipboard

Import dosen't works anymore :'(

Open t1gu1 opened this issue 8 years ago • 3 comments

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. :)

t1gu1 avatar May 08 '17 22:05 t1gu1

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.

trotzig avatar May 09 '17 09:05 trotzig

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!

t1gu1 avatar May 16 '17 17:05 t1gu1

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).

trotzig avatar May 16 '17 18:05 trotzig