public

Cucumber Language definition file for TextMate; modified to work with Sublime Text 2

  • Download Gist
Cucumber Plain Text Feature.tmLanguage
XML
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>fileTypes</key>
<array>
<string>feature</string>
</array>
<key>firstLineMatch</key>
<string>기능|機能|功能|フィーチャ|خاصية|תכונה|Функціонал|Функционалност|Функционал|Особина|Могућност|Özellik|Właściwość|Tính năng|Savybė|Požiadavka|Požadavek|Osobina|Ominaisuus|Omadus|OH HAI|Mogućnost|Mogucnost|Jellemző|Fīča|Funzionalità|Funktionalität|Funkcionalnost|Funkcionalitāte|Funcționalitate|Functionaliteit|Functionalitate|Funcionalitat|Funcionalidade|Fonctionnalité|Fitur|Feature|Egenskap|Egenskab|Crikey|Característica|Arwedd(.*)</string>
<key>foldingStartMarker</key>
<string>^\s*\b(예|시나리오 개요|시나리오|배경|背景|場景大綱|場景|场景大纲|场景|劇本大綱|劇本|例子|例|テンプレ|シナリオテンプレート|シナリオテンプレ|シナリオアウトライン|シナリオ|サンプル|سيناريو مخطط|سيناريو|امثلة|الخلفية|תרחיש|תבנית תרחיש|רקע|דוגמאות|Тарих|Сценарій|Сценарији|Сценарио|Сценарий структураси|Сценарий|Структура сценарію|Структура сценарија|Структура сценария|Скица|Рамка на сценарий|Примери|Пример|Приклади|Предыстория|Предистория|Позадина|Передумова|Основа|Мисоллар|Концепт|Контекст|Значения|Örnekler|Założenia|Wharrimean is|Voorbeelden|Variantai|Tình huống|The thing of it is|Tausta|Taust|Tapausaihio|Tapaus|Tapaukset|Szenariogrundriss|Szenario|Szablon scenariusza|Stsenaarium|Struktura scenarija|Skica|Skenario konsep|Skenario|Situācija|Senaryo taslağı|Senaryo|Scénář|Scénario|Schema dello scenario|Scenārijs pēc parauga|Scenārijs|Scenár|Scenariusz|Scenariul de şablon|Scenariul de sablon|Scenariu|Scenarios|Scenario Outline|Scenario Amlinellol|Scenario|Scenarijus|Scenariji|Scenarijaus šablonas|Scenarijai|Scenarij|Scenarie|Rerefons|Raamstsenaarium|Příklady|Példák|Príklady|Przykłady|Primjeri|Primeri|Primer|Pozadí|Pozadina|Pozadie|Plan du scénario|Plan du Scénario|Piemēri|Pavyzdžiai|Paraugs|Osnova scénáře|Osnova|Náčrt Scénáře|Náčrt Scenáru|Mate|MISHUN SRSLY|MISHUN|Kịch bản|Kontext|Konteksts|Kontekstas|Kontekst|Koncept|Khung tình huống|Khung kịch bản|Juhtumid|Háttér|Grundlage|Geçmiş|Forgatókönyv vázlat|Forgatókönyv|Exemplos|Exemples|Exemplele|Exempel|Examples|Esquema do Cenário|Esquema do Cenario|Esquema del escenario|Esquema de l'escenari|Esempi|Escenario|Escenari|Enghreifftiau|Eksempler|Ejemplos|EXAMPLZ|Dữ liệu|Dis is what went down|Dasar|Contoh|Contexto|Contexte|Contesto|Condiţii|Conditii|Cobber|Cenário|Cenario|Cefndir|Bối cảnh|Blokes|Beispiele|Bakgrunn|Bakgrund|Baggrund|Background|B4|Antecedents|Antecedentes|All y'all|Achtergrond|Abstrakt Scenario|Abstract Scenario)</string>
<key>foldingStopMarker</key>
<string>^\s*$</string>
<key>keyEquivalent</key>
<string>^~C</string>
<key>name</key>
<string>Gherkin</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#feature_element_keyword</string>
</dict>
<dict>
<key>include</key>
<string>#feature_keyword</string>
</dict>
<dict>
<key>include</key>
<string>#step_keyword</string>
</dict>
<dict>
<key>include</key>
<string>#strings_triple_quote</string>
</dict>
<dict>
<key>include</key>
<string>#strings_single_quote</string>
</dict>
<dict>
<key>include</key>
<string>#strings_double_quote</string>
</dict>
<dict>
<key>include</key>
<string>#comments</string>
</dict>
<dict>
<key>include</key>
<string>#tags</string>
</dict>
<dict>
<key>include</key>
<string>#scenario_outline_variable</string>
</dict>
<dict>
<key>include</key>
<string>#table</string>
</dict>
</array>
<key>repository</key>
<dict>
<key>comments</key>
<dict>
<key>captures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>comment.line.number-sign</string>
</dict>
</dict>
<key>match</key>
<string>\s*(#.*)</string>
</dict>
<key>table</key>
<dict>
<key>begin</key>
<string>^\s*\|</string>
<key>end</key>
<string>\|\s*$</string>
<key>name</key>
<string>keyword.control.cucumber.table</string>
<key>patterns</key>
<array>
<dict>
<key>match</key>
<string>\w</string>
<key>name</key>
<string>source</string>
</dict>
</array>
</dict>
<key>feature_keyword</key>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>keyword.language.gherkin.feature</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>string.language.gherkin.feature.title</string>
</dict>
</dict>
<key>match</key>
<string>^\s*(기능|機能|功能|フィーチャ|خاصية|תכונה|Функціонал|Функционалност|Функционал|Особина|Могућност|Özellik|Właściwość|Tính năng|Savybė|Požiadavka|Požadavek|Osobina|Ominaisuus|Omadus|OH HAI|Mogućnost|Mogucnost|Jellemző|Fīča|Funzionalità|Funktionalität|Funkcionalnost|Funkcionalitāte|Funcționalitate|Functionaliteit|Functionalitate|Funcionalitat|Funcionalidade|Fonctionnalité|Fitur|Feature|Egenskap|Egenskab|Crikey|Característica|Arwedd):(.*)\b</string>
</dict>
<key>step_keyword</key>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>keyword.language.gherkin.feature.step</string>
</dict>
</dict>
<key>match</key>
<string>^\s*(하지만|조건|먼저|만일|만약|단|그리고|그러면|那麼|那么|而且|當|当|前提|假設|假如|但是|但し|並且|もし|ならば|ただし|しかし|かつ|و |متى |لكن |عندما |ثم |بفرض |اذاً |כאשר |וגם |בהינתן |אזי |אז |אבל |Якщо |Унда |То |Припустимо що |Припустимо |Онда |Но |Нехай |Лекин |Когато |Када |Кад |К тому же |И |Задато |Задати |Задате |Если |Допустим |Дадено |Ва |Бирок |Аммо |Али |Але |Агар |А |І |Și |És |anrhegedig a |Zatati |Zakładając |Zadato |Zadate |Zadano |Zadani |Zadan |Youse know when youse got |Youse know like when |Yna |Ya know how |Ya gotta |Y |Wun |Wtedy |When y'all |When |Wenn |WEN |Và |Ve |Und |Un |Thì |Then y'all |Then |Tapi |Tak |Tada |Tad |Så |Stel |Soit |Siis |Si |Quando |Quand |Quan |Pryd |Pokud |Pokiaľ |Però |Pero |Pak |Oraz |Onda |Ond |Oletetaan |Og |Och |O zaman |Når |När |Niin |Nhưng |N |Mutta |Men |Mas |Maka |Majd |Mais |Maar |Ma |Lorsque |Lorsqu'|Kun |Kuid |Kui |Khi |Keď |Ketika |Když |Kai |Kada |Kad |Jeżeli |Ja |Ir |I CAN HAZ |I |Ha |Givun |Givet |Given y'all |Given |Gitt |Gegeven |Gegeben sei |Fakat |Eğer ki |Etant donné |Et |Então |Entonces |Entao |En |Eeldades |E |Duota |Dun |Donat |Donada |Diyelim ki |Dengan |Den youse gotta |De |Dato |Dar |Dann |Dan |Dado |Dacă |Daca |DEN |Când |Cuando |Cho |Cept |Cand |Cal |But y'all |But |Buh |Biết |Bet |BUT |Atès |Atunci |Atesa |Angenommen |And y'all |And |An |Ama |Als |Alors |Allora |Ali |Aleshores |Ale |Akkor |Aber |AN |A také |A |\* )</string>
</dict>
<key>feature_element_keyword</key>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>keyword.language.gherkin.feature.scenario</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>string.language.gherkin.scenario.title.title</string>
</dict>
</dict>
<key>match</key>
<string>^\s*(예|시나리오 개요|시나리오|배경|背景|場景大綱|場景|场景大纲|场景|劇本大綱|劇本|例子|例|テンプレ|シナリオテンプレート|シナリオテンプレ|シナリオアウトライン|シナリオ|サンプル|سيناريو مخطط|سيناريو|امثلة|الخلفية|תרחיש|תבנית תרחיש|רקע|דוגמאות|Тарих|Сценарій|Сценарији|Сценарио|Сценарий структураси|Сценарий|Структура сценарію|Структура сценарија|Структура сценария|Скица|Рамка на сценарий|Примери|Пример|Приклади|Предыстория|Предистория|Позадина|Передумова|Основа|Мисоллар|Концепт|Контекст|Значения|Örnekler|Założenia|Wharrimean is|Voorbeelden|Variantai|Tình huống|The thing of it is|Tausta|Taust|Tapausaihio|Tapaus|Tapaukset|Szenariogrundriss|Szenario|Szablon scenariusza|Stsenaarium|Struktura scenarija|Skica|Skenario konsep|Skenario|Situācija|Senaryo taslağı|Senaryo|Scénář|Scénario|Schema dello scenario|Scenārijs pēc parauga|Scenārijs|Scenár|Scenariusz|Scenariul de şablon|Scenariul de sablon|Scenariu|Scenarios|Scenario Outline|Scenario Amlinellol|Scenario|Scenarijus|Scenariji|Scenarijaus šablonas|Scenarijai|Scenarij|Scenarie|Rerefons|Raamstsenaarium|Příklady|Példák|Príklady|Przykłady|Primjeri|Primeri|Primer|Pozadí|Pozadina|Pozadie|Plan du scénario|Plan du Scénario|Piemēri|Pavyzdžiai|Paraugs|Osnova scénáře|Osnova|Náčrt Scénáře|Náčrt Scenáru|Mate|MISHUN SRSLY|MISHUN|Kịch bản|Kontext|Konteksts|Kontekstas|Kontekst|Koncept|Khung tình huống|Khung kịch bản|Juhtumid|Háttér|Grundlage|Geçmiş|Forgatókönyv vázlat|Forgatókönyv|Exemplos|Exemples|Exemplele|Exempel|Examples|Esquema do Cenário|Esquema do Cenario|Esquema del escenario|Esquema de l'escenari|Esempi|Escenario|Escenari|Enghreifftiau|Eksempler|Ejemplos|EXAMPLZ|Dữ liệu|Dis is what went down|Dasar|Contoh|Contexto|Contexte|Contesto|Condiţii|Conditii|Cobber|Cenário|Cenario|Cefndir|Bối cảnh|Blokes|Beispiele|Bakgrunn|Bakgrund|Baggrund|Background|B4|Antecedents|Antecedentes|All y'all|Achtergrond|Abstrakt Scenario|Abstract Scenario):(.*)</string>
</dict>
<key>scenario_outline_variable</key>
<dict>
<key>begin</key>
<string>&lt;</string>
<key>end</key>
<string>&gt;</string>
<key>name</key>
<string>variable.other</string>
</dict>
<key>strings_double_quote</key>
<dict>
<key>begin</key>
<string>"</string>
<key>end</key>
<string>"</string>
<key>name</key>
<string>string.quoted.double</string>
<key>patterns</key>
<array>
<dict>
<key>match</key>
<string>\\.</string>
<key>name</key>
<string>constant.character.escape.untitled</string>
</dict>
</array>
</dict>
<key>strings_single_quote</key>
<dict>
<key>begin</key>
<string>(?&lt;![a-zA-Z"])'</string>
<key>end</key>
<string>'(?![a-zA-Z])</string>
<key>name</key>
<string>string.quoted.single</string>
<key>patterns</key>
<array>
<dict>
<key>match</key>
<string>\\.</string>
<key>name</key>
<string>constant.character.escape</string>
</dict>
</array>
</dict>
<key>strings_triple_quote</key>
<dict>
<key>begin</key>
<string>"""</string>
<key>end</key>
<string>"""</string>
<key>name</key>
<string>string.quoted.single</string>
</dict>
<key>tags</key>
<dict>
<key>captures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>storage.type.tag.cucumber</string>
</dict>
</dict>
<key>match</key>
<string>(@[^@\r\n\t ]+)</string>
</dict>
</dict>
<key>scopeName</key>
<string>text.gherkin.feature</string>
<key>uuid</key>
<string>85E2C52C-9B16-4A54-81E7-6D8D3ADAEFA8</string>
</dict>
</plist>

Woot. Thank you for creating this. This is how I installed it on OS X

in SL2, Prefences > Browse Packages

Download the above gist
In the Browse Packages directory opened above (Packages) create a new folder. I called mine Cucumber

in that folder I copied the downloaded file, restarted SL2 and it worked

Hi, I tried downloading the instructions on the gist, but unfortunately it didn't work. I got the following error:

Error loading syntax file "Packages/Cucumber/Syntaxes/Cucumber Steps.tmLanguage": Error parsing plist xml: Failed to open file In file "Packages/Cucumber/Syntaxes/Cucumber Steps.tmLanguage"

What I did was the following instructions:

cd Library/Application\ Support/Sublime\ Text\ 2/Packages/
git clone git://github.com/cucumber/cucumber-tmbundle.git Cucumber
cd Cucumber/Syntaxes/
rm Cucumber\ Plain\ Text\ Feature.tmLanguage
wget https://raw.github.com/gist/864839/8752ef038ecaab8c9f3174b6ec419ed6f391e0c3/Cucumber%20Plain%20Text%20Feature.tmLanguage

Then I restarted Sublime Text 2, and it worked fine.

I can't seem to get any color syntax or anything running properly. Or is this only for the completion and etc?

It does syntax highlighting. Did you open a .feature file and do "view -> syntax -> open all with current extension as -> Cucumber -> Gherkin"?

Works for me on latest ST2 on Ubuntu, thanks!

Thanks! Works like a champ. Makes SublimeText just a little better.

Really useful, thanks for taking the time to share this.

I stumbled upon this and thought I'd mention this: https://github.com/sagework/cucumber-sublime2-bundle

Just clone it directly into your Packages folder and it'll be easy to update with a pull or fork your changes.

Is it just me, or does the "toggle comment" function not work in plain text feature files?

It's not just you. This only does syntax highlighting. The one linked above is the same; no commenting.
However, you can get close with the sagework one by doing this:
You can enable commenting by opening a .feature file and doing 'view -> syntax -> open all with current extension as -> Cucumber -> Cucumber Steps', but the syntax highlighting is a little different (not very much though)

@unixmonkey, I managed to solve the issue by creating a Comments.tmPreferences file in Packages/Cucumber, containing the following lines:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>name</key>
    <string>Comments</string>
    <key>scope</key>
    <string>text.gherkin.feature</string>
    <key>settings</key>
    <dict>
        <key>shellVariables</key>
        <array>
            <dict>
                <key>name</key>
                <string>TM_COMMENT_START</string>
                <key>value</key>
                <string># </string>
            </dict>
            <dict>
                <key>name</key>
                <string>TM_COMMENT_START_2</string>
                <key>value</key>
                <string>=begin
</string>
            </dict>
            <dict>
                <key>name</key>
                <string>TM_COMMENT_END_2</string>
                <key>value</key>
                <string>=end
</string>
            </dict>
        </array>
    </dict>
    <key>uuid</key>
    <string>98793a40-e7e7-473a-89ad-74d872ad3a3b</string>
</dict>
</plist>

That should solve the commenting problem

I am also getting this error:

Error loading syntax file "Packages/Cucumber/Cucumber Steps.tmLanguage": Error parsing plist xml: Failed to open file In file "Packages/Cucumber/Cucumber Steps.tmLanguage"

So I had to move the file out the Syntaxes directory and into the main root. Not sure why it was looking for it there, but now everything is working.

This is a great plugin. Exactly what i was looking for. Thanks!

thanks a lot, just what i was looking for...

Thanks @unixmonkey and @JeanMertz. Also, looks like user @sagework is gone/404.

Nice work. thx :)

This is beautiful. I did notice that it has the same issue that most apps have with color coding cucumber - the "([^"]*)" regex string always messes it up because of the middle quote. I've been solving it be doing a global replace to "(.+?)" when editing and reversing that when saving. Anybody seen an answer for that?

Is it possible to fix broken colors in cucumber steps files when using regular expressions ?

Thanks! This slotted beautifully into my Sublime Text 2 copy. I didn't even have to restart.

Can confirm that this works with Sublime 3 as well :-)

working great! thank you.

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.