提取函数 重构可以从代码段中创建函数。选择代码块并按 &shortcut:ExtractMethod; (重构 | 提取 | 函数)。

Extract method

此操作将产生以下结果:

Extracted method