TS auto import should support configuring whether a star or a qualified import is used.
See original GitHub issueFrom @dbaeumer on October 31, 2017 11:29
Testing: #37177
- vscode source code opened in VS Code
- open a file that doesn’t import
'vs/base/common/types'
- type isStringArray
- select the entry from code complete list
- the following import is inserted:
import { isStringArray } from 'vs/base/common/types';
However what I want in this case is
import * as Types from 'vs/base/common/types';
and the code should become Types.isStringArray
Would be cool if I can control this via a setting.
Copied from original issue: Microsoft/vscode#37258
Issue Analytics
- State:
- Created 6 years ago
- Reactions:14
- Comments:10 (7 by maintainers)
Top Results From Across the Web
Auto import | IntelliJ IDEA Documentation - JetBrains
Basic procedures to create and optimize imports in IntelliJ IDEA. Learn more how to import the missing import or XML namespace.
Read more >Is there auto-import functionality for typescript in Visual Studio ...
Automatically searches for TypeScript definitions in workspace files and provides all known symbols as completion item to allow code completion.
Read more >Untitled
If you need to use a lot of classes from a certain Java package, ... You can also add classes and packages to...
Read more >Language Support for Java(TM) by Red Hat
java.import.exclusions : Exclude folders from import via glob patterns. Use ! to negate patterns to allow subfolders imports. You have to include a ......
Read more >Stevens Creek Auto Imports in San Jose, CA - Capital One
Find new and used cars at Stevens Creek Auto Imports. ... Remember, you can use your mobile phone to configure pre-qualified financing for...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I would be happy if I could write an item name, find it in the completion list, press
<SOME_MODIFIER>+Tab/Enter
and have it import the thing as qualified. You could pick the name from file/module the item belongs to, with a kebab-/snakecase converted to camelcase. Rename refactoring could be then used on the qualified name if needed.i.e.
getName
completion could become:Copying my original problem here:
For example, now if I type
resolve
, VS Code auto suggests millions ofresolve
from all libraries. This is not helpful:For me, I usually have this
However now
path.
doesn’t have any auto import associated with suggestions.I hope
path.
can generate completion items that when accepted, add automatic imports to top. The expected behavior is:path.
@types/node
or the Automatic Type Acquisitionpath.resolve
, add to top of fileimport * as path from 'path'
I think if one types
resolve
, auto importimport { resolve } from 'path'
makes sense. However when one typespath.resolve
, auto import should doimport * as path from 'path'
.