Skip to content

Commit

Permalink
Merge pull request #9 from Codium-ai/update-docs
Browse files Browse the repository at this point in the history
Update docs
  • Loading branch information
almog-lv authored Mar 25, 2024
2 parents 0a1173d + 2cc7d0d commit 10ddc52
Show file tree
Hide file tree
Showing 19 changed files with 147 additions and 126 deletions.
1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ jobs:
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
echo "Google analytics ID = " + ${{ secrets.GOOGLE_ANALYTICS_ID }}
- uses: actions/setup-python@v5
with:
python-version: 3.x
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.cache/
docs/.DS_Store
.DS_Store
.idea/*
25 changes: 14 additions & 11 deletions docs/chat/commands/commit.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,22 @@ To utilize the `/commit` command effectively, follow these steps:
!!! tip "Threads"
This command supports threading. [Read more about Threads](../threads.md).

!!! example "Example 1 - using Chat"
!!! example "Commit message using Chat"
<kbd>![commit-chat](./assets/commit-chat.gif){width=700, loading=lazy}</kbd>

---
- **User**: Chooses Staged Changes mode
- **Command**: `/commit`
- **Codiumate Response**:

<kbd>![commit-chat](./assets/commit-chat.gif){width=700, loading=lazy}</kbd>

!!! example "Example 1 - using Source Control panel"
- **User**: Clicks on Auto Commit Message in Source Control panel
- **Codiumate Response**:
!!! example "Commit message from Source Control panel"

=== "VSCode"
<kbd>![commit-source](./assets/commit-source-vs.gif){width=700, loading=lazy}</kbd>
=== "VSCode"
<kbd>![commit-source](./assets/commit-source-vs.gif){width=700, loading=lazy}</kbd>
=== "JetBrains"
<kbd>![commit-source](./assets/commit-source-jb.gif){width=700, loading=lazy}</kbd>
=== "JetBrains"
<kbd>![commit-source](./assets/commit-source-jb.gif){width=700, loading=lazy}</kbd>

---
- **User**: Clicks on Auto Commit Message in Source Control panel

42 changes: 23 additions & 19 deletions docs/chat/commands/describe.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,29 +24,33 @@ To utilize the `/describe` command effectively, follow these steps:
This command supports threading. [Read more about Threads](../threads.md).


!!! example "Example 1"
!!! example "Features + Bug fixed PR Description"
- **User**: Plans to open a PR for a series of changes that include bug fixes and a new feature.
- **Command**: `/describe`
- **Codiumate Response**:
- **Title**: "Feature Addition and Bug Fixes in User Authentication Flow"
- **Type**: `Feature`, `Bug Fix`
- **Description**: Introduces a new two-factor authentication feature to enhance security during user login. Additionally, it addresses previously reported bugs in the password reset flow, including error handling and email verification. These changes improve the overall reliability and security of the authentication process.

!!! example "Example 2"
---
- **Title**: "Feature Addition and Bug Fixes in User Authentication Flow"
- **Type**: `Feature`, `Bug Fix`
- **Description**: Introduces a new two-factor authentication feature to enhance security during user login. Additionally, it addresses previously reported bugs in the password reset flow, including error handling and email verification. These changes improve the overall reliability and security of the authentication process.
---


!!! example "New feature PR Description"
- **User**: Plans to open a PR for a new feature X.
- **Command**: `/describe`
- **Codiumate Response**:
- **Title:** "Implement Feature X"
- **Type:** `Feature`
- **Description:** This pull request introduces a new middleware for user authentication. The middleware validates user credentials against the authentication service and grants access if authentication is successful. It enhances the security of our application by adding a layer of protection to routes that require user authentication.
---
- **Title:** "Implement Feature X"
- **Type:** `Feature`
- **Description:** This pull request introduces a new middleware for user authentication. The middleware validates user credentials against the authentication service and grants access if authentication is successful. It enhances the security of our application by adding a layer of protection to routes that require user authentication.
----

!!! example "Example 3 - With additional instructions"
!!! example "PR Description with additional instructions"
- **User**: Plans to open a PR for a new feature X.
- **Command**: `/describe and use these sub-headings in the description i.e. Nature of change, Change Score and Test suite added`
- **Codiumate Response**:
- **Title:** "Implement User Authentication Middleware"
- **Type:** `Feature`
- **Description:** This pull request introduces a new middleware for user authentication. The middleware validates user credentials against the authentication service and grants access if authentication is successful.
- Nature of change: It enhances the security of our application by adding an additional layer of protection to routes that require user authentication.
- Change Score: The change score is high.
- Test suite added: No test suite has been added with this change.
---
- **Title:** "Implement User Authentication Middleware"
- **Type:** `Feature`
- **Description:** This pull request introduces a new middleware for user authentication. The middleware validates user credentials against the authentication service and grants access if authentication is successful.
- Nature of change: It enhances the security of our application by adding an additional layer of protection to routes that require user authentication.
- Change Score: The change score is high.
- Test suite added: No test suite has been added with this change.
---
17 changes: 9 additions & 8 deletions docs/chat/commands/docstring.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,17 @@ To use the `/docstring` command, follow these steps:
!!! tip "Threads"
This command supports threading. [Read more about Threads](../threads.md).

!!! example "File Mode Example"
!!! example "Docsctring for component (File Mode)"
<kbd>![dosctring-file](./assets/docstring-file.gif){width=700, loading=lazy}</kbd>

---
- **User**: Selects a function that currently lacks a docstring.
- **Command**: `/docstring`
- **Codiumate Response**:

<kbd>![dosctring-file](./assets/docstring-file.gif){width=700, loading=lazy}</kbd>

!!! example "Workspace Mode Example"
- **User**: Chooses to improve docstrings across multiple files within the changeset.
- **Command**: `/docstring enhance readability`
- **Codiumate Response**:
!!! example "Docstring for Changeset (Workspace Mode)"
<kbd>![docstring-workspace](./assets/docstring-workspace.gif){width=700, loading=lazy}</kbd>

<kbd>![docstring-workspace](./assets/docstring-workspace.gif){width=700, loading=lazy}</kbd>
---
- **User**: Chooses to improve docstrings across multiple files within the changeset.
- **Command**: `/docstring enhance readability`
7 changes: 3 additions & 4 deletions docs/chat/commands/enhance.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@ To use the `/enhance` command, follow these steps:
- [File Mode](../modes/file-mode.md)

!!! example
<kbd>![enhance](./assets/enhance.gif){width=700, loading=lazy align=right}</kbd>

---
- **User**: Selects a complex and poorly documented function within their code.
- **Command**: `/enhance`
- **Codiumate Response**:

<kbd>![enhance](./assets/enhance.gif){width=700, loading=lazy}</kbd>

40 changes: 36 additions & 4 deletions docs/chat/commands/explain.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,40 @@ Follow these steps to leverage the `/explain` command effectively:


!!! example
- **User**: Chooses a complex algorithm within their code that they're struggling to understand.
- **Command**: `/explain`
- **Codiumate Response**:

---
The `get_file_patch_info` function extracts information about a file patch from a given patch string. It takes two inputs: `patch_str`, which is the patch string, and `file_name`, which is the name of the file. The function returns a `FilePatchInfo` object that contains information about the file patch.

<h4>Inputs</h4>
- `patch_str` (str): The patch string.
- `file_name` (str): The name of the file.

<h4>Flow</h4>
1. Split the patch string into lines.
2. Define a regular expression pattern to match the hunk header of the patch.
3. Initialize variables `start1`, `size1`, `start2`, and `size2` to -1.
4. Iterate over each line in the patch lines.
5. If a line starts with `@@`, match it against the hunk header pattern.
6. If a match is found, extract the start and size values for the original and modified file.
7. If the match is in the format `@@ -0,0 +1 @@`, handle it separately.
8. Break the loop after finding the first hunk header match.
9. Create a `FilePatchInfo` object with the extracted information and return it.

<h4>Outputs</h4>
- `FilePatchInfo`: A FilePatchInfo object containing information about the file patch.

<kbd>![explain](./assets/explain.gif){width=700, loading=lazy}</kbd>
<h4>Usage example</h4>
```
patch_str = "@@ -10,5 +10,7 @@\n some patch lines \n"
file_name = "example.txt"
patch_info = get_file_patch_info(patch_str, file_name)
print(patch_info.start1) # Output: 10
print(patch_info.size1) # Output: 5
print(patch_info.start2) # Output: 10
print(patch_info.size2) # Output: 7
```

---

- **User**: Chooses a complex algorithm within their code that they're struggling to understand.
- **Command**: `/explain`
7 changes: 4 additions & 3 deletions docs/chat/commands/find-on-github.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ Leverage the `/find-on-github` command by following these steps:
- [File Mode](../modes/file-mode.md)

!!! example

<kbd>![find-on-github](./assets/find-on-github.gif){width=700, loading=lazy}</kbd>

---
- **User**: Discovers a custom sorting algorithm within their project and wishes to see if similar implementations exist on GitHub.
- **Command**: `/find-on-github`
- **Codiumate Response**:

<kbd>![find-on-github](./assets/find-on-github.gif){width=700, loading=lazy}</kbd>

13 changes: 9 additions & 4 deletions docs/chat/commands/improve.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,21 @@ To utilize the `/improve` command, follow these instructions:
- [Workspace Mode](../modes/workspace-mode.md)

!!! example "File mode example"
<kbd>![/improve_file](./assets/improve-file.gif){width=700, loading=lazy}</kbd>

---
- **User**: Identifies a function suspected of having performance issues and security concerns.
- **Command**: `/improve`
- **Codiumate Response**:

<kbd>![/improve_file](./assets/improve-file.gif){width=700, loading=lazy}</kbd>


!!! example "Workspace Mode Example"

<kbd>![/improve_workspace](./assets/improve-workspace.gif){width=700, loading=lazy}</kbd>

---
- **User**: Aims to improve the overall quality of a branch
- **Command**: `/improve`
- **Codiumate Response**:

<kbd>![/improve_workspace](./assets/improve-workspace.gif){width=700, loading=lazy}</kbd>
22 changes: 1 addition & 21 deletions docs/chat/commands/issues.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,4 @@ Follow these steps to efficiently utilize the `/issues` command:
- [File Changes Mode](../modes/file-mode.md#file-changes)

!!! tip "Threads"
This command supports threading. [Read more about Threads](../threads.md).

<!-- <h2>Example</h2>
<h3>Workspace Mode Example</h3>
**User**: Wants to ensure their project is free from security vulnerabilities and coding errors before deployment.
[TBD]
**Command**: `/issues`
**Codiumate Response**: Codiumate identifies several issues, including:
- Security Concern: Insecure use of API keys detected in `config.js`.
- Potential Issue: Unhandled exception possibility in `paymentService.js`.
- Leftover Debugging Code: Console log found in `authController.js`.
- Misspelled Variable: "usreId" should be "userId" in `userModel.js`.
For each issue, Codiumate provides a direct link to the implicated code and a detailed description, helping the user understand and prioritize fixes.
**User Follow-Up**: Initiates a [thread](../threads.md) asking, "How can I secure the API keys?"
**Codiumate Suggestion**: Offers strategies for securing API keys, such as environment variables or secure vault services, along with links to further reading. -->
This command supports threading. [Read more about Threads](../threads.md).
14 changes: 10 additions & 4 deletions docs/chat/commands/quick-test.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,21 @@ To efficiently use the `/quick-test` command, follow these steps:
This command supports threading. [Read more about Threads](../threads.md).

!!! example "Example"

<kbd>![quick-test](./assets/quick-test.gif){width=700, loading=lazy}</kbd>

---
- **User**: Chooses a code without tests
- **Command**: `/quick-test`
- **Codiumate Response**:

<kbd>![quick-test](./assets/quick-test.gif){width=700, loading=lazy}</kbd>

!!! example "Example with Threading"

<kbd>![quick-test-thread](./assets/quick-test-thread.gif){width=700, loading=lazy}</kbd>

---
- **User**: Clicks on `Continue this Chat` after Codiumate's initial response
- **Command**: `use unittest framework`
- **Codiumate Response**:

<kbd>![quick-test-thread](./assets/quick-test-thread.gif){width=700, loading=lazy}</kbd>
13 changes: 1 addition & 12 deletions docs/chat/commands/recap.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,4 @@ To effectively utilize the `/recap` command, adhere to the following steps:
- [File Changes Mode](../modes/file-mode.md#file-changes)

!!! tip "Threads"
This command supports threading. [Read more about Threads](../threads.md).

<!-- <h2>Example</h2>
<h3>Workspace Mode Example</h3>
**User**: Prepares to summarize recent work on a new feature for a team meeting.
**Command**: `/recap`
[TBD] -->


This command supports threading. [Read more about Threads](../threads.md).
11 changes: 7 additions & 4 deletions docs/chat/commands/review.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ To make the most out of the `/review` command, follow these steps:
- [File Changes Mode](../modes/file-mode.md#file-changes)

!!! example "Example - Committed changes"
- **User:** Selects committed changes from current branch with target branch `main`
- **Command:** `/review`
- **Codiumate Response:**

---
<h4>Changes Analysis</h4>

Expand Down Expand Up @@ -55,4 +53,9 @@ To make the most out of the `/review` command, follow these steps:

**🔒 Security concerns:** No

**Changes Score:** 85
**Changes Score:** 85

---

- **User:** Selects committed changes from current branch with target branch `main`
- **Command:** `/review`
18 changes: 11 additions & 7 deletions docs/chat/commands/test-suite.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,20 @@ Implementing the `/test-suite` command involves a few straightforward steps:
- [File Mode](../modes/file-mode.md)

!!! example "Example"

<kbd>![test-suite](./assets/test-suite.gif){width=700, loading=lazy}</kbd>

---
- **User**: Chooses a code without tests
- **Command**: `/test-suite`
- **Codiumate Response**:

<kbd>![test-suite](./assets/test-suite.gif){width=700, loading=lazy}</kbd>
- **Command**: `/test-suite`

!!! example "Example with General Instructions"

<kbd>![test-suite-instructions](./assets/test-suite-instructions.gif){width=700, loading=lazy}</kbd>

---
- **User**: Chooses a code without tests
- **Command**: `/test-suite use Arrange, Act, Assert style`
- **Codiumate Response**:

<kbd>![test-suite-instructions](./assets/test-suite-instructions.gif){width=700, loading=lazy}</kbd>

13 changes: 1 addition & 12 deletions docs/chat/commands/update-changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,4 @@ Follow these steps to seamlessly update your changelog using the `/changelog` co
- [File Changes Mode](../modes/file-mode.md#file-changes)

!!! tip "Threads"
This command supports threading. [Read more about Threads](../threads.md).

<!-- <h2>Example</h2>
<h3>Workspace Mode Example</h3>
**User**: Needs to document recent enhancements and bug fixes in the project's changelog before a new release.
**Command**: `/update-changelog`
**Codiumate Response**: Generates a structured changelog entry, such as:
[TBD] -->
This command supports threading. [Read more about Threads](../threads.md).
4 changes: 2 additions & 2 deletions docs/chat/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ To suit the context of your work, Codiumate offers three distinct modes:
- **File Mode**: Focuses on the current file, offering detailed assistance and command functionality for selected lines, components, or file changes.
- **Workspace Mode**: Expands Codiumate's scope to your entire project workspace, allowing for comprehensive analysis and actions on changesets. Available for Teams and Enterprise users.

Each mode is designed to optimize Codiumate's assistance based on the scope of your coding tasks. [Discover more about modes](../modes/imdex.md).
Each mode is designed to optimize Codiumate's assistance based on the scope of your coding tasks. [Discover more about modes](./modes/index.md).

### Commands
Codiumate provides a suite of commands tailored to various coding needs, from generating docstrings and reviewing code to identifying issues and updating changelogs. Commands like [`/ask`](./commands/ask.md), [`/explain`](./commands/explain.md), [`/commit`](./commands/commit.md), and [`/improve`](./commands/improve.md) are just the beginning of what Codiumate can do to support your coding journey. [Learn more about commands](./commands/index.md).

### Threads
Threads in Codiumate enable you to dive deeper into specific inquiries or commands. After an initial command execution, the "continue this chat" button allows for a threaded conversation, providing space for refinement, additional queries, and expanded discussions. This feature is invaluable for iterating on solutions, clarifying complex topics, and ensuring you get the most out of Codiumate's capabilities. [Explore threading](../threads.md).
Threads in Codiumate enable you to dive deeper into specific inquiries or commands. After an initial command execution, the "continue this chat" button allows for a threaded conversation, providing space for refinement, additional queries, and expanded discussions. This feature is invaluable for iterating on solutions, clarifying complex topics, and ensuring you get the most out of Codiumate's capabilities. [Explore threading](./threads.md).
Loading

0 comments on commit 10ddc52

Please sign in to comment.