# Debugging

The Debugging feature is both powerful and easy to use. It can help you to identify, debug and solve coding issues quickly and easily, increasing your overall efficiency.&#x20;

In order for the Debugging feature to work properly, the AI needs to receive enough code so that it can understand the context of the code and fix it accordingly. Descriptive names for functions, classes and variables should be used. This type of naming will help the AI understand the context and provide a valid solution.

### Step 1 :

Log in first with Google Authentication on Kodezi.

<figure><img src="https://1546495129-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuCUGeAGoLnKn0XrQ3cCn%2Fuploads%2FdTYQfAmfu4j93MWL6Okq%2FStep%2003%20(1).png?alt=media&#x26;token=e5c4f5b8-4dff-4e3c-9225-ecb84b56026f" alt=""><figcaption></figcaption></figure>

### Step 2 :

After successfully logging in, select the Debugging button for the short method, or use the context menu when right-clicking the code editor.

<div><figure><img src="https://1546495129-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuCUGeAGoLnKn0XrQ3cCn%2Fuploads%2Ft1FC3LlFGoHlpSniw9LG%2FFrame%2055935.png?alt=media&#x26;token=ea3a02cb-dca7-4d96-9679-99df731b09ea" alt=""><figcaption><p>Kodezi Quick Explorer</p></figcaption></figure> <figure><img src="https://1546495129-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuCUGeAGoLnKn0XrQ3cCn%2Fuploads%2Ff4bwYygrGvzNNn29uJ1w%2FFrame%2055937.png?alt=media&#x26;token=7b0c63b9-be34-4397-921c-6a1a590c39a9" alt=""><figcaption><p>Visual Studio Code Context Menu</p></figcaption></figure></div>

{% hint style="warning" %}
Kodezi does not support extremely large sections of code, so you may have to select a block of code for debugging if guided to do so.
{% endhint %}

### Step 3 :

After clicking the debugging button, the debugging process will start.

<figure><img src="https://1546495129-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuCUGeAGoLnKn0XrQ3cCn%2Fuploads%2FRU7jZDlZjctDoUQLKznn%2Fdebug2.png?alt=media&#x26;token=c6f09c35-2b1e-43fd-bfce-ecc0778ac86d" alt=""><figcaption></figcaption></figure>

### Step 4 :

You will see results similar to these in your IDE once the debugging process is finished.

<figure><img src="https://1546495129-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuCUGeAGoLnKn0XrQ3cCn%2Fuploads%2FMaYGIEQcXjW9nGz6in3W%2FGenerate%20Documentation%20Select%20Type.png?alt=media&#x26;token=8d9c59c0-f019-42fd-83c8-71492ae8fef4" alt=""><figcaption></figcaption></figure>

### Step 5:

You can correct errors by word, line, and one-click to fix all issues.

<figure><img src="https://1546495129-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuCUGeAGoLnKn0XrQ3cCn%2Fuploads%2FWEDj7ymjmsq0YtiNaXFk%2FFrame%2055930.png?alt=media&#x26;token=61a0ca2c-771d-497c-96ae-3645471dfedc" alt=""><figcaption></figcaption></figure>

1. Fix Line will fix the issues only on line 57.
2. purple button "NEW\_LINE" will replace the word "const RevAs=CallReverse()" into a new line.
3. Fix All Issues will fix errors at one click and the solution will replace your original file.

### Tips

The AI's main purpose is to make sure your code is able to be compiled. So if you use the debugging feature and the code is incomplete, the AI will try to complete the code so it can be compiled. Since comments aren't required to make code compile, if there are comments in the code, then, the comments may be removed. Try to input code that is standalone and can be compiled. The following are some examples of good and bad code for debugging;

**Good Code Input;**

<figure><img src="https://1546495129-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuCUGeAGoLnKn0XrQ3cCn%2Fuploads%2FdT9BsceRVTbJkZAIUpq5%2Fimage.png?alt=media&#x26;token=21d35c9c-1803-4963-806d-ee346bc5b230" alt=""><figcaption><p>Complete in context, has functions which are being used in other functions present so AI doesn't try to generate it to make the code compilable.</p></figcaption></figure>

**Bad Code Input;**

<figure><img src="https://1546495129-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuCUGeAGoLnKn0XrQ3cCn%2Fuploads%2FJZIYYMEDrD87XJyMpB0B%2Fimage.png?alt=media&#x26;token=52c99310-62f7-4cb6-b376-68a8aa10e494" alt=""><figcaption><p>Incomplete in context, functions which being used are not declared in the scope so AI will try to fix this, disrupting the codes flow when the debugged code is integrated back into the original pipeline.</p></figcaption></figure>

##


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.kodezi.com/feature-guides/debugging.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
