PHP IDE具有最佳代码完成? [英] PHP IDE with best code completion?

查看:78
本文介绍了PHP IDE具有最佳代码完成?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尽管有些人可能会说,但我相信代码完成(又称Intellisense)是代码编辑器的第二个最佳发明(第一个是语法着色)。它确实使编码更容易,因为我不必担心我是否将函数命名为 CalculateReportSums ReportSumsCalculate 或者只是 GetReportSums

Despite what some might say, I believe that code completion (aka Intellisense) is the second best invention when it comes to code editors (the first being syntax coloring). It really makes coding easier because I don't have to worry whether I named the function CalculateReportSums, ReportSumsCalculate or simply GetReportSums.

不幸的是,我还没有找到一个能够令人满意地为PHP实现此功能的代码编辑器。而且令人满意的意思是和Visual Studio for C#一样好。

Unfortunately I have not yet found a code editor which would satisfactory implement this feature for PHP. And by "satisfactory" I mean "as good as Visual Studio for C#".

我的第一个文本编辑器选择是Notepad ++,但它只有一个PHP的内置列表-in函数,只有在按下Ctrl + SPACE后才会出现。我也尝试过Eclipse + PDT,这是更好的,但仍然经常有打嗝,有时完全失败没有明显的原因(没有列表可用),并且只有在我暂停键入时才会出现(将超时设置为某个小值会导致列表不会完全出现。)

My first choice of text editor is Notepad++, but that only has a list of PHP's built-in functions, and it only appears after you hit Ctrl+SPACE. I've also tried Eclipse+PDT, which is better, but still often has hiccups, sometimes fails altogether for no apparent reason (no list available), and always appears only when I pause typing (setting the timeout to some small value causes the list not to appear altogether).

那么 - 那里有更好的东西吗?能够知道当前范围内所有变量的东西,能够跟随 include() s,并且会在我输入时实时显示列表?

So - is there something better out there? Something that would be aware of all the variables in the current scope, that would be able to follow include()s, and would display the list in real-time as I type?

我知道PHP是一种动态语言,完整的代码完成原则上是不可能的(因为你不知道在运行之前会有什么变量),但它应该仍然有可能在相当好的程度上实现它 - 比我到目前为止看到的要好得多。

I know that PHP is a dynamic language and a perfect code-completion is impossible in principle (because you don't know what variables will be there until runtime), but it should still be possible to implement it to a fairly good degree - much better than what I've seen so far.

已添加:添加几个小点 - 我希望CC是即时的,就像在Visual Studio中一样。我键入一个字符,列表显示在同一时刻。我输入另一个字符,列表变成一半,甚至可以闪烁。接近零的CPU使用率,即时结果(所有人都欢呼神的缓存!)。

Added: To add a few minor points - I want the CC to be instantaneous, like in Visual Studio. I type a character, and the list shows at the same instant. I type another character and the list becomes half the size before I can even blink. Near-zero CPU usage, instantaneous results (all hail the Gods of caching!).

另外 - 我很好用特殊方式记录我的函数甚至变量。我更喜欢PHPLint语法(因为之后我可以用它检查我的代码),但其他语法也可以。强制执行此操作对您的评论规则也有好处。 :)

Also - I'm fine with documenting my functions and even variables in a special way. I prefer PHPLint syntax (because then I can check my code with it later), but other syntaxes will do as well. Forcing to do this is also good for your commenting discipline. :)

推荐答案

我发现Netbeans的代码完成程度比Aptana好。当我使用codeigniter时,Netbeans会在Aptana不会使用的模型中为我的静态方法编写完整的代码。

I have found that Netbeans has better code completion than Aptana. When I was working with codeigniter, Netbeans would code complete for my static methods in models where Aptana wouldn't.

自从我发布此消息后,JetBrains发布了PHPStorm并具有快速智能感知功能,以及更好的类型提示功能。它绝对优于所有其他恕我直言。我已经免费使用EAP 2.0几个月了。

Since my posting of this, JetBrains has released PHPStorm and has your rapid fire intellisense, as well as even better type hinting. It is absolutely superior to all others IMHO. I've been using EAP 2.0 for several months now for free.

这篇关于PHP IDE具有最佳代码完成?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆