atom-typescript icon indicating copy to clipboard operation
atom-typescript copied to clipboard

Auto import feature

Open cevek opened this issue 10 years ago • 36 comments

Webstorm have cool feature like auto import entities from indexed files

for example we are typing: new Foo() and WS prompt "import Foo from 'foo.ts'?" if we says yes, then it append to header import {Foo} from './deep/folder/path/foo' jhl ts - del - --dev-del 2015-12-16 13-20-51

cevek avatar Dec 16 '15 10:12 cevek

Cool. Some guidance : https://github.com/TypeStrong/atom-typescript/blob/master/docs/quickfix.md

:warning: Its hard stuff that needs close attention ... so instead of marking up for grabs marking as wishlist as I value contributor time and effort :rose:

basarat avatar Dec 18 '15 00:12 basarat

Great! But why import foo = require('../foo') instead of import {foo} from '../foo'?

cevek avatar Dec 21 '15 08:12 cevek

why import foo = require('../foo') instead of import {foo} from '../foo'?

import foo = is not the same as import {foo}. it is more like import * as foo :rose:

basarat avatar Dec 21 '15 22:12 basarat

I have a PR (https://github.com/TypeStrong/atom-typescript/pull/791) submitted that adds a quick fix option for an "import from" statement.

jschwarty avatar Dec 22 '15 07:12 jschwarty

I got a missing dependency "Cannot find name ", but get no quick fix suggestion. I am on version 7.16.1. Any advice?

Thanks for your work - this feature is much needed.

ambition-consulting avatar Jan 08 '16 15:01 ambition-consulting

@amb-it-ion can you share the code snippet. Might be the canProvideFix check is not valid for your code https://github.com/TypeStrong/atom-typescript/pull/791/files#diff-8fa30ff973791698c79754125ec84700R39

basarat avatar Jan 11 '16 01:01 basarat

+1

dawidk92 avatar Feb 26 '16 10:02 dawidk92

+1

Regaddi avatar Mar 02 '16 20:03 Regaddi

+1

sharpmachine avatar Apr 25 '16 22:04 sharpmachine

Please note that the TypeScript team is investigating a QuickFix api similar to Refactor api. Everyone is ofcourse is free to do whatever, this was just info :rose:

basarat avatar Apr 25 '16 22:04 basarat

Sorry, guys but is it working right now? really want to use atom with TS, but without auto import feature like in Webstrom, feels really akward :)

satanworker avatar Jul 17 '16 10:07 satanworker

+1

gvlekke avatar Aug 05 '16 12:08 gvlekke

+1 This is the reason I stay with Webstorm. There is a package that does this for regular js. Could it be ported to work for ts?

jonaskello avatar Sep 15 '16 22:09 jonaskello

+1

fernandogomesdf avatar Oct 26 '16 19:10 fernandogomesdf

please 👍

tuliogalli avatar Nov 27 '16 21:11 tuliogalli

If I understand correctly this PR adds this feature to the TS language service. If that is true I guess it is just a matter of connecting it.

jonaskello avatar Nov 27 '16 21:11 jonaskello

+1

I"m a noob in atom but maybe https://atom.io/packages/typescript-modules-helper this one could be helpful.

dogancana avatar Nov 28 '16 14:11 dogancana

i need it!

ctretyak avatar Mar 22 '17 13:03 ctretyak

I need it too!! 😄

guncha avatar Mar 22 '17 14:03 guncha

please please +1

elvnthaus avatar Mar 23 '17 03:03 elvnthaus