自动 class 在 Sublime Text 中导入
Auto class importing in Sublime Text
我希望在 Sublime Text 中自动 class 导入。我正在使用 HaxeFlixel,每当我添加 private var _btnPlay:FlxButton
时,所需的导入不会自动显示。我怎样才能让它成为默认操作?是否有我不知道的热键?
我知道在 FlashDevelop 中可以做到这一点 tutorial 我在后面说是这样的:
We need to define a new FlxButton
variable to use as our 'play' button. So, type:
private var _btnPlay:FlxButton;
Note: if you're using FlashDevelop, it should automatically create an import for FlxButton (import flixel.ui.FlxButton;) at the top of the class. This should be mostly automatic whenever you use class, but if it doesn't add it for some reason, you can enter it manually, or, highlight FlxButton in the editor and hit Ctrl+Shift+1 to add it.
看起来 "Organize Imports" 添加了缺失的导入 - here 是添加此功能的拉取请求。
它的默认快捷方式需要按 Ctrl+Shift+H
和 Ctrl+Shift+O
。您可能想将其重新分配给更短的内容,也许只是 Ctrl+Shift+O
:
[
{ "keys": ["ctrl+shift+o"], "command": "haxe_organize_imports" }
]
我希望在 Sublime Text 中自动 class 导入。我正在使用 HaxeFlixel,每当我添加 private var _btnPlay:FlxButton
时,所需的导入不会自动显示。我怎样才能让它成为默认操作?是否有我不知道的热键?
我知道在 FlashDevelop 中可以做到这一点 tutorial 我在后面说是这样的:
We need to define a new
FlxButton
variable to use as our 'play' button. So, type:
private var _btnPlay:FlxButton;
Note: if you're using FlashDevelop, it should automatically create an import for FlxButton (import flixel.ui.FlxButton;) at the top of the class. This should be mostly automatic whenever you use class, but if it doesn't add it for some reason, you can enter it manually, or, highlight FlxButton in the editor and hit Ctrl+Shift+1 to add it.
看起来 "Organize Imports" 添加了缺失的导入 - here 是添加此功能的拉取请求。
它的默认快捷方式需要按 Ctrl+Shift+H
和 Ctrl+Shift+O
。您可能想将其重新分配给更短的内容,也许只是 Ctrl+Shift+O
:
[
{ "keys": ["ctrl+shift+o"], "command": "haxe_organize_imports" }
]