Pycharm 简明教程

Pycharm - Macros

宏和 Omni 之间的差异在 PyCharm 编辑器中很微妙。Omni 允许您跳转到编辑器的确切位置或没有特殊意义的代码指定位置。另一方面,宏允许用户浏览函数和类或特定类方法。

The difference between a macro and Omni is subtle in PyCharm Editor. Omni allows you to go to the exact location of editor or a specified place of code with no particular significance. Macro on the other hand allows the user to navigate through functions and classes or particular class method.

Navigate Macro

观察以下屏幕截图以更好地理解 Navigate 宏 −

Observe the following screenshot for a better understanding of Navigate macro −

navigate macro

Navigate → Declaration 有助于显示声明、类型声明以及定义超级方法。类型声明中包含的各种属性如下所示 −

The Navigate → Declaration helps to show declaration, type declaration and to define super methods. Various attributes included in the type declaration are shown below −

navigate declaration

但是,此宏存在一个问题,如果用户尝试跳转到 .so 对象的声明,例如从 datetime 模块导航到 select 模块,那么每次它都会遇到 stub 文件。

However, there is an issue with this macro, if a user tries to go to the declaration of a .so object for example, navigating from datetime module to select module, then each time it will encounter the stub file.

Search Everywhere

它有助于搜索类和关联的方法。它还包括通过 Google 搜索的选项。

It helps to search the classes and associated methods. It includes the option to search with Google as well.

search anywhere

这些部分中的每一个部分都会在其部分名称旁边包含一个快捷键组合。 Search Everywhere 是 PyCharm 中其他搜索操作的网关。

Each of these parts includes a shortcut key combination next to its section name. Search Everywhere is a gateway to other search actions available in PyCharm.