dongtong848825 2014-04-19 06:28
浏览 68
已采纳

如何在netbeans中重构

I'm new to PHP development and Netbeans use, but I'm struggling to find a way of writing my code more smoothly. Some time ago I've watched some episodes from Uncle's Bob Clean Code video series. He was using IntelliJIDEA and I was thinking that some of the features he was using were available only to that IDE. Yesterday I was watching a Tuts+ video tutorial, and the author was using some Netbeans IDE features which I'll also like to use.

The features I'm talking about are:

  1. refactoring, by renaming a variable name. I know that I can use rightClick-> Refactor-> Rename, but the author did it without using this approach.
  2. Create Method if the method was just declared in test file and not defined in the source file. In the video, a contextual menu appears under the method, exactly as in VS or Eclipse. Do I need to use a plugin? Is there a key combination which will allow me to see that contextual menu under my function names?

enter image description here

Don't get me wrong. I did my homework by searching online, but I didn't find the solutions for the problems from above. For example "Create Method" approach appears as a request/bug in Netbeans forums, but the developer from the video was using it.

PS:
I found the answer for my first problem. He was using Ctrl+R 2 shortcut. I assume that for the second problem, there has to be a shortcut key combination too, but I can't fins it. More exactly, I don't know what to look for in the Options->Keymap

  • 写回答

3条回答 默认 最新

  • dqpc1845 2014-04-19 20:32
    关注

    The 2nd comes if you press Alt+Enter on the line where the method is being called. Or you can click on the bulb icon on the left.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?