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

Importing from node_modules/@types is broken #30

Open
iyegoroff opened this issue Mar 20, 2017 · 7 comments
Open

Importing from node_modules/@types is broken #30

iyegoroff opened this issue Mar 20, 2017 · 7 comments

Comments

@iyegoroff
Copy link

If tsimporter.preferRelative is true import statement is not being added automatically when selecting symbol from drop-down menu.

@pmneo
Copy link
Owner

pmneo commented Mar 20, 2017

Please take a look into the dev console for any error outputs and paste in here.

@iyegoroff
Copy link
Author

file: 'file:///Users/iyegoroff/Documents/dev/js/ts-test/test.ts'
severity: 'Error'
message: 'Cannot find name 'Component'.'
at: '1,1'
source: 'ts'

@pmneo
Copy link
Owner

pmneo commented Mar 21, 2017

Please provide a sample project.

@iyegoroff
Copy link
Author

https://github.com/iyegoroff/ts-importer-bug

Autoimporting works only for Something symbol, but not for Component.

ts-importer symbols

{
	"knownSymbols": {
		"Component": [
			{
				"name": "Component",
				"module": "react",
				"isDefault": false
			}
		],
		"Something": [
			{
				"name": "Something",
				"path": "/Users/iyegoroff/Documents/dev/js/ts-test/temp.ts",
				"type": "const",
				"isDefault": false
			}
		]
	}
}

@pmneo
Copy link
Owner

pmneo commented Mar 21, 2017

This is currently not implemented. See Todo section:

Follow up /// declarations
Process node_modules//*.d.ts
Process typings/
/*.d.ts

Those can just be imported if a import statement exists in any ts file

@k8w
Copy link

k8w commented Aug 23, 2017

So have this is implemented now?

@pmneo
Copy link
Owner

pmneo commented Sep 25, 2017

No ...
This is hard work to do, because of the wildcard export feature like export * from './zone'; which may be nested too.

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

3 participants