Friday, June 24, 2011

DevTnT v2.2 – Notepad++/SpecFlow: Syntax Highlighting for Feature Files

Of course, our favorite text editor Notepad++ gives us syntax highlighting. Although the installation comes with a great set of predefined languages, the gherkin format used for SpecFlow-/Cucumber feature files is not supported out of the box.

Luckily, it is possible to define the bits and pieces for custom languages. In this blog post, Jaco Swarts provides the complete XML file with the language definition for for the gherkin language.

Great!

Due to the mismatch of language features of Notepad++ and language constructs in gherkin, some things are not possible with syntax highlighting:

Tables and Comments

In Jaco’s language definition, tables are considered single line comments as this seems to be the only way to format tables nicely. But table headers cannot be treated differently as done in Visual Studio (see comparison below). As second consequence, real gherkin comments (prefaced by a hash mark – #) are not supported at all. But I think this was a good consideration since tables will be more vital on skimming over a feature file than comments are.

Multiline strings

Gherkin supports multiline strings, delimited by triple quotes. Also this seems not to be possible with the language features of Notepad++.

See the following screenshot for a comparison of the different renderings:

Formatting of English feature file both in Visual Studio and Notepad++

Version for Feature Files in German

Since one major goal of BDD is to raise the bandwidth of the communication channel between all stakeholders of a project including the business/domain experts, it is vital to have feature files in the communication language of the project.

If you are using feature files in German, you want to take advantage of that language definition for Notepad++: http://dl.dropbox.com/u/9238896/gherkin_de.xml. The keywords in this file are taken from the language file of the SpecFlow project.

Issue with gherkin keyword “Funktionalität” (Feature)

Up to now, I did not manage to get Notepad++ to accept the keyword “Funktionalität” correctly. That seems to be the case because of the umlaut a. Although stated as XML entity and displayed properly in the language dialog, it is not rendered as the other keywords:

Formatting of German feature file both in Visual Studio and Notepad++

Note

There seems to be a problem having both the English and the German version installed in parallel. Sometimes the highlighting worked fine, but sometimes event a manual language switch from German to English gherkin (language menu) did not work.

Any hints regarding that are appreciated!

45 comments:

  1. Oh Paul, if you think that Notepad and Specflow are the only ones that had this issue, then I bet you're never worked with Emacs. I used to work in coop with some french coders through this thing. Trying to do some magic with synthax highlighting in the way you do in this post, the whole application's settings became corrupted suddenly - it let me to open some files occasionally and went down right after a few seconds. Fortunately, I found the right tool in the first hour of my googling. It is just a simple app, that repairs all file associations really fast and help me to open and work with every file formats as well as to open .txt file https://wikiext.com/txt So, I really suggest you to keep this one closer to yourself, or - moreover - switch to another up-to-dated text editor

    ReplyDelete
  2. I am very impressed with your post because this post is very beneficial for me and provide a new knowledge to me
    axcrack
    crackbay
    suripc
    prosvst
    crackproz
    softcrack
    cractivator
    vstlicense.com


    ReplyDelete
  3. I am very impressed with your post because this post is very beneficial for me and provide a new knowledge to me
    axcrack
    crackbay
    suripc
    prosvst
    focus keyword
    cractivator
    softcrack
    VSTlicense

    ReplyDelete
  4. Thanks for shearing this kind of information fxfactory

    ReplyDelete
  5. I am very impressed with your post because this post is very beneficial for me and provide a new knowledge to me
    axcrack
    crackbay
    suripc
    prosvst
    crackproz
    softcrack
    cractivator
    vstlicensed

    ReplyDelete
  6. I am very impressed with your post because this post is very beneficial for and provide a new knowledge to me. Thanks for sharing.
    TweakBit Anti-Malware Crack

    ReplyDelete
  7. I guess I am the only one who came here to share my very own experience. Guess what!? I am using my laptop for almost the past 2 years, but I had no idea of solving some basic issues. I do not know how to Download Cracked Pro Softwares But thankfully, I recently visited a website named vstfull.com
    AnyDVD HD Crack
    Bitdefender Total Security Crack
    NCH DrawPad Pro Crack

    ReplyDelete
  8. I guess I am the only one who came here to share my very own experience. Guess what!? I am using my laptop for almost the past 2 years, but I had no idea of solving some basic issues. I do not know how to Download Cracked Pro Softwares But thankfully, I recently visited a website named vstfull.com
    Advanced System Protector Crack
    Sparkol VideoScribe Crack
    Wondershare Filmora Scrn Crack

    ReplyDelete
  9. Many thanks for sharing such incredible knowledge. It's really good for your website.
    The info on your website inspires me greatly. This website I'm bookmarked. Maintain it and thanks again.
    I'm really impressed with your writing skills, as smart as the structure of your weblog.
    ApowerMirror Crack

    ReplyDelete
  10. I am very impressed with your post because this post is very beneficial for me and provide a new knowledge..
    https://crackexe.net/https://crackexe.net/
    apowermirror-crack
    steganos-privacy-suite-crack

    ReplyDelete
  11. Great work with the hard work you have done I appreciate your work thanks for sharing it...
    Dropbox Crack

    ReplyDelete

  12. I guess I am the only one who came here to share my very own experience. Guess what!? I am using my laptop for almost the past 2 years, but I had no idea of solving some basic issues. I do not know how to Download Cracked Pro Softwares But thankfully, I recently visited a website named cracksnew.org
    Ummy Video Downloader Crack

    ReplyDelete
  13. Amazing blog! I really like the way you explained such information about this post with us. And blog is really helpful for us this website.
    FxFactory Pro Crack
    Topaz Studio Crack
    ManyCam Pro Crack
    cracksite.net

    ReplyDelete
  14. Amazing blog! I really like the way you explained such information about this post with us. And blog is really helpful for us this website.
    Bitdefender Total Security Crack
    windowsup.net

    ReplyDelete
  15. Your post is very informative. I want to share this post with more people, so I bookmarked your website and shared your post on my website. Thanks for your help
    english short english stories

    ReplyDelete
  16. Hello, this sites gives very interesting information about off season camping, really i like this information which is so much beneficial to us, keep sharing such kind of information, Thanks for sharing this type of information. download MAGIX Movie Edit Pro

    ReplyDelete
  17. Great job on the hard work you've put in; I really appreciate it, and I appreciate you sharing it with us....
    Notepad+8.1.9.3 Crack

    ReplyDelete
  18. I am really amazed with your post since it is extremely useful to me and provides me with fresh information....
    Notepad+8.1.9.3 Crack

    ReplyDelete
  19. We open a polite route to your blog after reading over some of the blog entries on your website.
    We've added our list of bookmarked pages to the list and will examine them in the near future. Please take a look at my website and tell us what you think.
    Good luck with everything; you put in a lot of effort, and I appreciate and thank you for sharing it.
    Dropbox Crack

    ReplyDelete
  20. I like your all post. You have done really good work. Thank you for the information you provide, it helped me a lot. I hope to have many more entries or so from you.
    https://licensedinfo.com/
    Steganos Privacy Suite
    UNFORMAT Professional

    ReplyDelete
  21. I like your all post. You have done really good work. Thank you for the information you provide, it helped me a lot. I hope to have many more entries or so from you.
    Very interesting blog.
    vstkey.com
    ApowerMirror Crack

    ReplyDelete
  22. Wow, amazing block structure! How long
    Have you written a blog before? Working on a blog seems easy.
    The overview of your website is pretty good, not to mention what it does.
    In the content!
    https://softwarezpc.com/dropbox-crack/

    ReplyDelete
  23. I like your all post. You have done really good work. Thank you for the information you provide, it helped me a lot. I hope to have many more entries or so from you.
    Very interesting blog.
    Gravit Designer Pro Crack
    Ummy Video Downloader Crack
    MacDrive Pro Crack
    WebcamMax Crack
    Panda Dome Premium Crack
    Camtasia Studio Crack
    NTLite Crack
    iMazing Crack
    downloadpc.co

    ReplyDelete
  24. Wow, amazing block structure! How long
    Have you written a blog before? Working on a blog seems easy.
    The overview of your website is pretty good, not to mention what it does.
    In the content!
    vstkey.com
    Redshift Render Crack

    ReplyDelete
  25. I guess I am the only one who came here to share my very own experience. Guess what!? I am using my laptop for almost the past 2 years, but I had no idea of solving some basic issues. I do not know how to Crack Softwares Free Download But thankfully, I recently visited a website named ProCrackHere
    Apowermirror Crack
    Vsdc Video Editor Crack

    ReplyDelete
  26. Our the purpose is to share the reviews about the latest Jackets,Coats and Vests also share the related Movies,Gaming, Casual,Faux Leather and Leather materials available WW2 Bomber Jacket

    ReplyDelete
  27. I am a professional web blogger so visit my website link is given below!To get more information
    Autodesk 3ds Max Crack/

    ReplyDelete
  28. I am a professional web blogger so visit my website link is given below! To get more information
    AnyDVD HD Crack/

    ReplyDelete