danielfrey/sublime-cucumber-step-finder

语言: Python

git: https://github.com/danielfrey/sublime-cucumber-step-finder

一个崇高的插件,提供轻松导航到黄瓜的步骤(
A plugin for sublime providing easy navigation to steps in Cucumber (
README.md (中文)

Sublime Text 2/3插件:Cucumber Step Finder

这个插件支持Rails开发人员轻松导航到他们的黄瓜(http://cukes.info)步骤。

它现在提供两个命令

  • 一个列出了打开项目中的所有步骤并让您选择 使用内置机制进行搜索的步骤。
  • 第二个让你在站立时通过调用“MatchStep”-Command跳转到相应的步骤 在功能文件中的步骤

安装

Mac OSX(手册)

cd ~/Library/Application\ Support/Sublime\ Text\ 2/Packages
git clone git://github.com/danielfrey/sublime-cucumber-step-finder.git CucumberStepFinder

Linux / Windows的

尚未测试。欢迎捐款。如果提供了键盘设置,它应该可以工作。

包装控制

建议通过包控制进行安装。它将在可用时更新您的包。要安装,请执行以下操作。

  • 在命令选项板中,输入Package Control:Install Package
  • 搜索CucumberStepFinder

用法

“搜索”的默认键绑定分别是super + y(ctrl + alt + y) ctrl + super + m(ctrl + shift + m)表示“匹配”。 如果已在配置中使用了一个,请更改它

或者,超级+单击要素文件中的行以查找其定义(OSX)

组态

到目前为止,可以使用以下设置。

{
   "open_in_different_pane"  :  true,
   "cucumber_features_path"  :  "features",
   "cucumber_step_pattern"   :  ".*_steps.*\\.rb",
   "cucumber_code_keywords"  :  ["given", "when", "then", "and","but", "und", "dann", "wenn", "gegeben sei", "angenommen"]
}

该插件将cucumber_features_path视为项目的直接子目录,因为它是Rails项目中的默认子目录。如果您的步骤位于不同的子目录中,请覆盖此设置。

在给定的功能目录中,它使用第二个设置来查找递归匹配cucumber_step_pattern的步骤文件

为了找到匹配步骤,CucumberStepFinder需要知道哪些是黄瓜关键字。由于英语旁边有不同的关键字,您可以在cucumber_code_keywords中配置它们。 默认情况下,预定义英语和德语。

要找出要配置的关键字,例如德语(语言代码`de), 类型

cucumber --i18n de

进入控制台。最后一个参数是语言代码。  将标有“代码”的所有单词添加到设置中。

选项“open_in_different_pane”允许您定义步骤文件是否在不同的窗格中打开。对于仅使用单个窗格的用户,请将此标志切换为false。

项目特定配置

可以在全局或.sublime-project文件中更改这些设置。

"settings":
{
  "CucumberStepFinder":
  {
    "cucumber_step_pattern": ".*\\.rb"
  }
}

本文使用googletrans自动翻译,仅供参考, 原文来自github.com

en_README.md

Sublime Text 2/3 plugin: Cucumber Step Finder

This plugin supports Rails developers to easily navigate to their cucumber (http://cukes.info) steps.

It provides by now two commands

  • One listing all steps in the open project and letting you choose
    a step using the built-in mechanism for search.
  • The second one letting you jump to the corresponding step by calling the "MatchStep"-Command when standing
    on a step in the features file

Installation

Mac OSX (manual)

cd ~/Library/Application\ Support/Sublime\ Text\ 2/Packages
git clone git://github.com/danielfrey/sublime-cucumber-step-finder.git CucumberStepFinder

Linux/Windows

Not tested yet. Contributions are welcome. If keyboard settings are provided, it should work.

Package Control

Installation through package control is recommended. It will handle updating your packages as they become available. To install, do the following.

  • In the Command Palette, enter Package Control: Install Package
  • Search for CucumberStepFinder

Usage

The default key-binding for "search" is super + y (ctrl + alt + y), respectively
ctrl + super + m (ctrl + shift + m) for "match".
Change it if one is already used in your configuration

Alternatively super+click the line in a features file to find it's definition (OSX)

Configuration

The following settings are available so far.

{
   "open_in_different_pane"  :  true,
   "cucumber_features_path"  :  "features",
   "cucumber_step_pattern"   :  ".*_steps.*\\.rb",
   "cucumber_code_keywords"  :  ["given", "when", "then", "and","but", "und", "dann", "wenn", "gegeben sei", "angenommen"]
}

The plugin looks for cucumber_features_path as a direct subdirectory of your project as it's the default in Rails projects. Override this setting if your steps are located in a different subdirectory.

In the given features directory it uses the second setting for finding step-files recursively matching the cucumber_step_pattern

For finding the matching step, CucumberStepFinder needs to know which are the cucumber-keywords. Since there are different keywords beside English, you can configure them in cucumber_code_keywords.
By default English and German are predefined.

To find out, which keywords to configure e.g. German (language code `de),
type

cucumber --i18n de

into the console. The last argument is the language code.
Add all words marked with "code" to the settings.

The option "open_in_different_pane" lets you define, whether the steps file is opened in a different pane or not. For those working with a single pane only, switch this flag to false.

Project Specific Configuration

These settings can be changed globally, or in your .sublime-project file.

"settings":
{
  "CucumberStepFinder":
  {
    "cucumber_step_pattern": ".*\\.rb"
  }
}