graza / jEditCucumberMode

Edit mode files for the jEdit editor that provide multi-lingual highlighting of Cucumber feature files.
0 stars 2 forks source link

Hard coded paths in XML #1

Open graza opened 12 years ago

graza commented 12 years ago

Issue

Currently the XML mode definition files have hard coded paths from the jEdit installation on my Windows machine. This means that for someone else to install this code, they have to first edit the XML files before the edit mode will work. It would be nice to not have these hard coded values at all, but jEdit seems to be limited in what directories the XML parser will check when including external DTDs into the XML's inline DTD.

Also, as at the current time of writing, this repository only includes four languages (en, en-lol, no, it). So more need to be added. Continuing with the current approach would only make this issue worse.

Solution

It would be better to create a command line tool that will regenerate the mode files from the list of languages that Gherkin knows about. It should be able to regenerate the mode definitions after Gherkin is updated, avoid clobbering pre-existing mode "catalog" files installed on the user's environment, and pick up any necessary environment-specific directories to be included in the generated XML mode definition files.

graza commented 11 years ago

generate_xml_files.rb script now exists which addresses the "spoken languages" by loading gherkin/i18n and iterating over the available languages. Running the script in jEdit's modes directory will address the "hard-coded paths" issue for which this issue was raised.

Probably need to move this into a gem form, or jEdit plugin, which probably means rewriting the script in Java/bean shell? However it's not clear how that would interact with the Ruby version of gherkin?