<commit_before>==========
Developing
==========

If you are developing a project that is included in Spoofax it is recommended to set up a development environment.
This section describes how to set up such a development environment.

Requirements
------------

A working **Spoofax build** is required before being able to develop. You must be able to successfully build Spoofax by running `./b build all`. Do not continue if this does not work. Follow the :ref:`previous section <dev-build>` for instructions on how to build Spoofax.

Eclipse
-------

Currently, an Eclipse development environment is the most supported environment. An Eclipse development environment can be generated with our scripts.

Generating an Eclipse instance
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The :command:`./b` script in the spoofax-releng repository can generate an Eclipse installation for you.
Change directory into the :file:`spoofax-releng` repository and run:

.. code:: bash

   ./b gen-spoofax -l -d ~/eclipse/spoofax-dev

This will download and install Eclipse into :file:`~/eclipse/spoofax-dev` with the right plugins and :file:`eclipse.ini` for Spoofax development. The locally built version of the Spoofax plugin will be installed into that Eclipse. Generating an Eclipse installation can take several minutes. After it's done generating, open the Eclipse installation and confirm that it works by creating a Spoofax project.

.. note:: |macOS| macOS: If upon starting Eclipse you get the error *To open "Eclipse" you need to install the legacy Java SE 6 runtime*, then you should install a Java JDK 6 or newer for Eclipse to use. If you installed one through `SDKMAN! <https://sdkman.io/>`_ then you have to point Eclipse to it. To do this, edit the ``Contents/Eclipse/eclipse.ini`` file in the Eclipse application package content. Add the following lines just before the ``-vmargs`` argument, where ``<USERNAME>`` is your username:
  
  .. code:: bash

     -vm
     /Users/<USERNAME>/.sdkman/candidates/java/current/jre/lib/jli/libjli.dylib


Fixing Eclipse settings<commit_msg>Troubleshooting Conflicting Dependency error when generating Eclipse<commit_after>==========
Developing
==========

If you are developing a project that is included in Spoofax it is recommended to set up a development environment.
This section describes how to set up such a development environment.

Requirements
------------

A working **Spoofax build** is required before being able to develop. You must be able to successfully build Spoofax by running `./b build all`. Do not continue if this does not work. Follow the :ref:`previous section <dev-build>` for instructions on how to build Spoofax.

Eclipse
-------

Currently, an Eclipse development environment is the most supported environment. An Eclipse development environment can be generated with our scripts.

Generating an Eclipse instance
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The :command:`./b` script in the spoofax-releng repository can generate an Eclipse installation for you.
Change directory into the :file:`spoofax-releng` repository and run:

.. code:: bash

   ./b gen-spoofax -l -d ~/eclipse/spoofax-dev

This will download and install Eclipse into :file:`~/eclipse/spoofax-dev` with the right plugins and :file:`eclipse.ini` for Spoofax development. The locally built version of the Spoofax plugin will be installed into that Eclipse. Generating an Eclipse installation can take several minutes. After it's done generating, open the Eclipse installation and confirm that it works by creating a Spoofax project.

.. note:: If you get an error ``Installation failed. Cannot complete the install because of a conflicting dependency.``, then make sure there is not an existing Eclipse instance at the destination.

.. note:: |macOS| macOS: If upon starting Eclipse you get the error *To open "Eclipse" you need to install the legacy Java SE 6 runtime*, then you should install a Java JDK 6 or newer for Eclipse to use. If you installed one through `SDKMAN! <https://sdkman.io/>`_ then you have to point Eclipse to it. To do this, edit the ``Contents/Eclipse/eclipse.ini`` file in the Eclipse application package content. Add the following lines just before the ``-vmargs`` argument, where ``<USERNAME>`` is your username:
  
  .. code:: bash

     -vm
     /Users/<USERNAME>/.sdkman/candidates/java/current/jre/lib/jli/libjli.dylib


Fixing Eclipse settings
{'fraction_non_alphanumeric': 0.09703872437357632, 'fraction_numerical': 0.0009111617312072893, 'mean_word_length': 4.264988009592326, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1157395', 'n_tokens_mistral': 1175, 'n_tokens_neox': 1086, 'n_words': 588}