.. Reminder for header structure:
  Parts (H1)          : #################### with overline
  Chapters (H2)        : ******************** with overline
  Sections (H3)        : ====================
  Subsections (H4)    : --------------------
  Subsubsections (H5) : ^^^^^^^^^^^^^^^^^^^^
  Paragraphs (H6)      : """""""""""""""""""""

.. meta::
  :description: Creating WAPT packages IDE
  :keywords: working, WAPT, personalizing, creating packages, documentation

.. |vscode| image:: wapt-resources/icon_visual-studio-text-editor.png
  :alt: Visual Studio text editor

.. |vscodium| image:: wapt-resources/icon_vscodium-text-editor.png
  :alt: VSCodium text editor

.. |vim| image:: wapt-resources/icon_vim-text-editor.png
  :alt: Vim text editor

.. |pyscripter| image:: wapt-resources/icon_pyscripter-text-editor.png
  :alt: Pyscripter text editor

.. |pycharm| image:: wapt-resources/icon_pycharm-text-editor.png
  :alt: Pycharm text editor

.. |notepad++| image:: wapt-resources/icon_notepadpluplus-text-editor.png
  :alt: Notepad ++ text editor

.. |nano| image:: wapt-resources/icon_nano-text-editor.png
  :alt: Nano text editor

.. role:: green
.. role:: orange
.. role:: red

.. _envdev_setup:

.. _using_different_development_environments:

#################################################
Using different IDEs for developing WAPT packages
#################################################

**************************************
Configuring WAPT to use supported IDEs
**************************************

If you are used to work with another :term:`IDE`, you can be relieved now as WAPT supports many popular text editors.

.. note::

    Using a supported IDE will launch the WAPT package project with a valid debug configuration.

On Windows
==========

.. list-table:: Natively supported text editors in WAPT on Windows
  :header-rows: 1
  :widths: 50, 50

  * - Text editor name
    - Text editor logo
  * - :program:`PyScripter`
    - |pyscripter|
  * - :program:`Visual Studio Code`
    - |vscode|
  * - :program:`Visual Studio Codium`
    - |vscodium|

To configure another editor for WAPT, you **MUST** modify the :code:`editor_for_packages` attribute in the ``[global]`` section of your WAPT Console's :file:`%LOCALAPPDATA%\\waptconsole\\waptconsole.ini` configuration file.

.. code-block:: ini

   [global]
   ...
   editor_for_packages = vscode

On Linux / macOS
================

.. list-table:: Natively supported text editors in WAPT on Windows
  :header-rows: 1
  :widths: 50, 50

  * - Text editor name
    - Text editor logo
  * - :program:`Visual Studio Code`
    - |vscode|
  * - :program:`Visual Studio Codium`
    - |vscodium|
  * - :program:`Nano`
    - |nano|
  * - :program:`Vim`
    - |vim|

To configure another editor for WAPT, you **MUST** modify the :code:`editor_for_packages` attribute in the ``[global]`` section of your WAPT Agent configuration file: :file:`/opt/wapt/wapt-get.ini`.

By default, if the :code:`editor_for_packages` attribute is empty, WAPT will try to launch (in that order):

* :program:`vscodium`;
* :program:`vscode`;
* :program:`nano`;
* :program:`vim`;
* :program:`vi`.

.. code-block:: ini

   [global]
   ...
   editor_for_packages = vim

***************************************
Configuring WAPT to use a custom editor
***************************************

.. tabs::

  .. code-tab:: ini Windows

    [global]
    ...
    editor_for_packages = C:\Program Files\Notepad++\notepad++.exe {setup_filename}

  .. code-tab:: ini Linux/ macOS

    [global]
    ...
    editor_for_packages = /opt/pycharm/bin/pycharm_x64 {wapt_sources_dir}

Custom arguments
================

.. list-table:: Arguments for the :code:`editor_for_packages` option
  :header-rows: 1
  :widths: 50 50

  * - Argument
    - Description
  * - :code:`{setup_filename}`
    - Launches custom editor and edit WAPT package :file:`setup.py` file.
  * - :code:`{control_filename}`
    - Launches custom editor and edit WAPT package :file:`control` file.
  * - :code:`{wapt_sources_dir}`
    - Launches the custom text editor and opens the WAPT package folder.
  * - :code:`{wapt_base_dir}`
    - Launches the custom text editor and opens the WAPT install folder.
