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

如何在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

图片转代码服务由CSDN问答提供 功能建议

我是PHP开发和Netbeans使用的新手,但我很难找到编写代码的方法 更顺利。 前段时间我看过Uncle的Bob Clean Code视频系列剧集。 他正在使用IntelliJIDEA,我认为他使用的一些功能仅适用于该IDE。 昨天我正在观看 Tuts + video 教程,作者是 使用我也想使用的一些Netbeans IDE功能。

我正在谈论的功能是:

  1. 通过重命名变量名来重构。 我知道我可以使用rightClick-> Refactor-> 重命名,但作者没有使用这种方法就这样做了。
  2. 如果方法刚刚在测试文件中声明而未在源文件中定义,则创建方法。 在视频中,上下文菜单显示在方法下,与VS或Eclipse完全相同。 我需要使用插件吗? 是否有一个组合键可以让我在我的函数名下看到上下文菜单?

    不要误会我的意思。 我通过在线搜索完成了我的作业,但我没有找到上述问题的解决方案。 例如,“创建方法”方法在 Netbeans论坛中显示为请求/错误 ,但视频的开发人员正在使用它。

    PS:
    我找到了第一个问题的答案。 他正在使用 Ctrl + R 2 快捷方式。 我认为对于第二个问题,也必须有一个快捷键组合,但我不能鳍它。 更准确地说,我不知道在选项 - >键映射 中寻找什么

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

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.

    点赞 打赏 评论
  • douangzhao4108 2014-04-19 07:04

    It could be that it was night build from here: http://bits.netbeans.org/download/trunk/nightly/latest/

    点赞 打赏 评论
  • douceng7070 2014-10-23 19:44

    The 1st comes if you press Strg+R after selecting the name of the variable or method you wish to rename!

    If not go to tools/options/keymap and search for "Rename", there you are able to define a shortcut!

    点赞 打赏 评论

相关推荐 更多相似问题