本文介绍了Visual Studio Code 中的打字稿是否有自动导入功能?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有任何快捷方式可以让我自动生成我的打字稿导入?就像在类型名称旁边按 ctrl+space 并将导入声明放在文件顶部一样.如果没有,那么填写模块引用路径的智能感知怎么样,这样我就不必手动完成了?我真的很想使用 vscode,但不得不为打字稿进行手动导入让我很沮丧.

解决方案

我相信名为TypeScript Importer"的插件完全符合您的意思:

有了它,您可以真正使用 + 来选择您想要导入的内容.

您可以从 ++ 菜单或仅通过粘贴 ext install tsimporter 在用 + 打开的快速打开菜单中.

Is there any shortcut that will allow me to auto generate my typescript imports? Like hitting ctrl+space next to the type name and having the import declaration placed at the top of the file. If not, what about intellisense for filling out the module reference path so that I wont have to do it manually? I would really love to use vscode but having to do manual imports for typescript is killing me.

解决方案

I believe the plugin called "TypeScript Importer" does exactly what You mean: https://marketplace.visualstudio.com/items?itemName=pmneo.tsimporter .

With it You can truly use + to choose what exactly You would like to be imported.

You can find and install it from ++ menu or just by pasting ext install tsimporter in Quick Open menu opened with +.

这篇关于Visual Studio Code 中的打字稿是否有自动导入功能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 23:35