FlexBuilder 中的类型补全?

发布于 2024-07-21 05:57:25 字数 186 浏览 3 评论 0原文

是否可以让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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

温暖的光 2024-07-28 05:57:25

至少到 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.

蝶…霜飞 2024-07-28 05:57:25

有一个插件可以为 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:

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文