FlexBuilder 中的类型补全?
是否可以让FlexBuilder自动填写语句的类型?
例如:
var g = this.graphics;
将抛出一个“无类型声明”警告,Eclipse 的魔法“请修复此行”将无法修复...那么除了手动输入“g:Graphics”之外,还有其他方法可以修复该问题吗? ?
Is it possible to ask FlexBuilder to automatically fill out the types of a statement?
For example:
var g = this.graphics;
Will throw a a "no type declaration" warning that Eclipse's magic "fix this line please" won't fix... So is there any other way to fix that, other than manually entering the "g:Graphics" by hand?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
至少到 FlexBuilder 3 为止,唉,如果您想遵守编译器的严格类型规则,则必须声明类型,而且我不知道其中存在现有的“推断此变量的类型”功能任何地方,要么。
不过,我确信这是设计使然 - 那些想要严格类型的好处的人将通过显式声明来获得它们,而那些可能更喜欢在运行时更改“g”所指内容的人可以欣赏能够关闭编译器警告(项目 > 属性 > Flex 编译器)并执行此操作。
希望我能为你提供更好的答案! 也许其他人知道一些事情并且可以提出更令人满意的解决方案。 :)
如果只是额外的字符让您烦恼,您可以尝试使用 Eclipse/FlexBuilder 快捷方式(例如,Ctrl+Space 用于类型自动完成)-- 这里有一个很棒的列表。
At least up to and including FlexBuilder 3, alas, you'll have to declare the type if you want to comply with the compiler's strict-typing rules, and I don't know of an existing "infer this variable's type" feature in there anywhere, either.
I'm sure that's by design, though -- those who want the benefits of strict typing will get them by declaring explicitly, whereas those who might prefer to change what "g" refers to at runtime can appreciate being able to switch off compiler warnings (Project > Properties > Flex Compiler) and do so.
Wish I had a better answer for ya! Perhaps someone else knows of something and can chime in with a more satisfying solution. :)
If it's just the extra characters that bug you, you might try using the Eclipse/FlexBuilder shortcuts (e.g., Ctrl+Space for type auto-completion) -- there's a great list of them here.
有一个插件可以为 Eclipse 即时编写代码片段,也许您可以创建一些东西来解决您的问题:
更多信息:
There's a plug in to write code snippets on the fly for eclipse, maybe you can create something that solves your problem:
More here: