mirror of
https://github.com/sourcegraph/sourcegraph.git
synced 2026-02-06 18:51:59 +00:00
Cody: Add docs on generate index (#52206)
This commit is contained in:
parent
4fab72322a
commit
3218f7d9d8
@ -49,7 +49,7 @@ export const ChatInputContext: React.FunctionComponent<{
|
||||
</h3>
|
||||
) : contextStatus.supportsKeyword ? (
|
||||
<h3 title={warning} className={classNames(styles.badge, styles.indexMissing)}>
|
||||
<a href="https://docs.sourcegraph.com/cody/explanations/code_graph_context">
|
||||
<a href="https://docs.sourcegraph.com/cody/troubleshooting#codebase-is-not-indexed">
|
||||
<span className={styles.indexStatus}>⚠ Not Indexed</span>
|
||||
<span className={styles.indexStatusOnHover}>Generate Index</span>
|
||||
</a>
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
# Explanations
|
||||
|
||||
- [Enabling Cody for Sourcegraph Enterprise](enabling_cody_enterprise.md)
|
||||
- [Enabling Cody with Sourcegraph.com](enabling_cody.md)
|
||||
- [Installing the Cody VS Code extension](installing_vs_code.md)
|
||||
- [Enabling Cody with Sourcegraph.com](enabling_cody.md)
|
||||
- [Installing the Cody VS Code Extension](installing_vs_code.md)
|
||||
- [Configuring code graph context](code_graph_context.md)
|
||||
- [Generating Index to Enable Codebase-Aware Answers](indexing.md)
|
||||
70
doc/cody/explanations/indexing.md
Normal file
70
doc/cody/explanations/indexing.md
Normal file
@ -0,0 +1,70 @@
|
||||
# Generate Index to Enable Codebase-Aware Answers
|
||||
|
||||
These docs provide instructions on how to generate an index that enables codebase-aware answers for Cody. Codebase-aware answers leverage code graph context to enhance Cody's understanding of code from selected codebases.
|
||||
|
||||
By following the steps outlined in this guide, you can configure the necessary prerequisites and enable Cody to provide more accurate and contextually relevant answers to your coding questions based on the codebase you are working in.
|
||||
|
||||
## Generate Index
|
||||
|
||||
You can enhance Cody's understanding of existing code by generating index for your codebases to enable [code graph context](code_graph_context.md).
|
||||
|
||||
### Sourcegraph Enterprise
|
||||
|
||||
To generate an index for your codebase and enable codebase-aware answers for Cody, your site admin must complete the following:
|
||||
|
||||
- [Configure Code Graph Context](code_graph_context.md) for your Sourcegraph instance
|
||||
- [Enable Cody for your Sourcegraph instance](enabling_cody_enterprise.md#step-1-enable-cody-on-your-sourcegraph-instance)
|
||||
- [Enable Cody for your Sourcegraph account](enabling_cody_enterprise.md#turning-cody-off)
|
||||
|
||||
### Sourcegraph.com
|
||||
|
||||
See the current [list of repositories with code graph context available](../embedded-repos.md), and request any that you'd like to add by pinging a Sourcegraph team member in the [Sourcegraph Discord](https://discord.gg/8wJF5EdAyA) under the `#cody-embeddings` channel.
|
||||
|
||||
> NOTE: Sourcegraph.com does not support connections to private repositories
|
||||
|
||||
## Enable Codebase-Aware Answers
|
||||
|
||||
|
||||
When connected to the correct codebase, Cody provides accurate and relevant answers to your coding questions, taking into account the context of the codebase you are currently working in.
|
||||
|
||||
Cody attempts to connect to the appropriate codebase automatically using Git, eliminating the need for manual configuration of the `Cody: Codebase` (`cody.codebase`) option.
|
||||
|
||||
You only need to configure the `Cody: Codebase` (`cody.codebase`) setting if Cody displays `NOT INDEXED` below the chat window.
|
||||
|
||||
|
||||
### Extension Settings
|
||||
|
||||
|
||||
Cody tries to connect to the correct codebase using Git at start-up, so manual configuration of `cody.codebase` is unnecessary.
|
||||
|
||||
To enable Cody to set the codebase config using `git remote get-url origin`, ensure that the `Cody: Codebase` (`cody.codebase`) configuration field is unset in your VS Code User and Workspace settings, and remote workspace and folder-level settings if applicable.
|
||||
|
||||
If this attempt fails and you see `NOT INDEXED` below your Cody chatbox, you can manually specify the correct codebase for Cody using the `Cody: Codebase` (`cody.codebase`) configuration option.
|
||||
|
||||
#### Manual Configuration
|
||||
|
||||
Follow these steps to manually configure the `codebase` setting for Cody via the [Extension Settings](https://code.visualstudio.com/docs/getstarted/settings#_extension-settings) in VS Code:
|
||||
|
||||
1. Open the VS Code workspace settings by clicking:
|
||||
- Mac: `Code` > `Settings` > `Settings`
|
||||
- Windows & Linux: `File` > `Preferences (Settings)`
|
||||
2. Switch to the Workspace settings tab
|
||||
3. Enter `Cody: Codebase` in the search bar
|
||||
4. Enter the repository name as listed on your Sourcegraph instance in the `Cody: Codebase` field
|
||||
|
||||
For example, the name for the [Sourcegraph repository on Sourcegraph.com](https://sourcegraph.com/github.com/sourcegraph/sourcegraph) is `github.com/sourcegraph/sourcegraph`, so we will enter it to the setting field without the https protocol as:
|
||||
|
||||
```
|
||||
github.com/sourcegraph/sourcegraph
|
||||
```
|
||||
|
||||
### Settings.json
|
||||
|
||||
Alternatively, you can configure `codebase` manually via [settings.json](https://code.visualstudio.com/docs/getstarted/settings#_settingsjson) using the `cody.codebase` configuration contribution point:
|
||||
|
||||
```json
|
||||
{
|
||||
"cody.serverEndpoint": "https://sourcegraph.com",
|
||||
"cody.codebase": "github.com/sourcegraph/sourcegraph"
|
||||
}
|
||||
```
|
||||
@ -1,8 +1,6 @@
|
||||
# <picture title="Cody"><img class="theme-dark-only" src="https://storage.googleapis.com/sourcegraph-assets/cody/20230417/logomark-default-text-white.png" width="200"><img class="theme-light-only" src="https://storage.googleapis.com/sourcegraph-assets/cody/20230417/logomark-default-text-black.png" width="200"><div style="display:none">Cody</div></picture>
|
||||
|
||||
<span class="badge badge-beta">Beta</span>
|
||||
|
||||
Cody is an AI code assistant that writes code and answers questions for you by reading your entire codebase and the code graph.
|
||||
<span class="badge badge-beta">Beta</span> Cody is an AI code assistant that writes code and answers questions for you by reading your entire codebase and the code graph.
|
||||
|
||||
Cody uses a combination of Sourcegraph's code graph and Large Language Models (LLMs) to eliminate toil and keep human devs in flow. You can think of Cody as your coding assistant who has read through all the code in open source, all the questions on StackOverflow, and your own entire codebase, and is always there to answer questions you might have or suggest ways of doing something based on prior knowledge.
|
||||
|
||||
@ -20,11 +18,11 @@ There are currently two ways to experience Cody:
|
||||
|
||||
Cody is available as a [VS Code extension](https://marketplace.visualstudio.com/items?itemName=sourcegraph.cody-ai) and in the Sourcegraph web interface.
|
||||
|
||||
<div class="cta-group">
|
||||
<a class="btn btn-primary" href="quickstart">★ Cody quickstart</a>
|
||||
<a class="btn" href="explanations/use_cases">Cody use cases</a>
|
||||
<a class="btn" href="faq">FAQ</a>
|
||||
<a class="btn" href="https://discord.com/servers/sourcegraph-969688426372825169">Join our Discord</a>
|
||||
<div class="getting-started">
|
||||
<a class="btn btn-primary text-center" href="quickstart">★ Cody quickstart</a>
|
||||
<a class="btn text-center" href="explanations/use_cases">Cody use cases</a>
|
||||
<a class="btn text-center" href="faq">FAQ</a>
|
||||
<a class="btn text-center" href="https://discord.com/servers/sourcegraph-969688426372825169">Join our Discord</a>
|
||||
</div>
|
||||
|
||||
## Features
|
||||
|
||||
@ -24,3 +24,13 @@ command 'cody.set-access-token' not found
|
||||
5. Try opening VS Code again
|
||||
|
||||

|
||||
|
||||
### Codebase is `Not Indexed`
|
||||
|
||||
If you are logged into Sourcegraph.com, only public open source repositories on [this list](embedded-repos.md) are indexed. Please join the [Sourcegraph Discord](https://discord.gg/8wJF5EdAyA) and message the `#cody-embeddings` channel to get an open source repository added to the public index.
|
||||
|
||||
If you’re connected to a Sourcegraph Enterprise instance, please ask your site admin to [Configure Code Graph Context](explanations/code_graph_context.md) for your Sourcegraph instance and then [Enable Cody](explanations/enabling_cody_enterprise.md) for your account.
|
||||
|
||||
If you've completed the above and still seeing your codebase showing up as `NOT INDEXED`, try updating the `Cody: Codebase` (`cody.codebase`) setting in VS Code to the repository name as listed on your Sourcegraph instance.
|
||||
|
||||
For more information, see [Generate Index to Enable Codebase-Aware Answers](explanations/indexing.md).
|
||||
|
||||
Loading…
Reference in New Issue
Block a user