.. _Problem_Auto-correct:

Problem Auto-correct
====================

AI Assistant has the ability to **auto-correct** and **explain** compilation problems.

In order to trigger problem auto-correction you may:

1.  
    - Eclipse: Place the cursor on the problem's line and press :kbd:`Ctrl+1`, **right-click** and select :menuselection:`Source --> Quick Fix` from the context menu, or trigger the context menu of an entry from the :ref:`Problems View` and select the **Quick Fix** command.
    - VS Code: Place the cursor inside the problem highlight range (squiggle underline) and select the **Quick Fix...** command, :kbd:`click` on the light-bulb, or trigger the context menu of an entry from the :ref:`Problems View`.
2.  Select the **Fix ... using DVT AI Assistant**
    proposal from the dropdown list

.. figure:: ../../images/common/fix-and-explain-with-ai-assistant.png


.. note::

    -  To customize the Problem Auto-correct prompt, run the **DVT AI: Create New Problem Auto-correct Blueprint** command and modify the generated blueprint. The newly added blueprints will be accessible from within the proposals list alongside the builtin one.
    -  To customize the Explain Problem prompt, run the **DVT AI: Edit Predefined Blueprint** command and select the **Explain problem (chat)** option.
    
.. note::

    To generate performant fixes, the LLM requests may include:

    -  Contents of the current file
    -  Type dependencies from other files
    -  Recently opened files
