diff --git a/docs/cody/clients/feature-reference.mdx b/docs/cody/clients/feature-reference.mdx index 84fb4c389..799c3c7d6 100644 --- a/docs/cody/clients/feature-reference.mdx +++ b/docs/cody/clients/feature-reference.mdx @@ -4,28 +4,27 @@ ## Chat -| **Feature** | **VS Code** | **JetBrains** | **Web** | **CLI** | -| ---------------------------------------- | ----------- | ------------- | -------------------- | ------- | -| Chat with Cody | ✅ | ✅ | ✅ | ✅ | -| Chat history | ✅ | ✅ | ✅ | ❌ | -| Clear chat history | ✅ | ✅ | ✅ | ❌ | -| Edit sent messages | ✅ | ❌ | ✅ | ❌ | -| Show context files | ✅ | ✅ | ✅ | ❌ | -| @-file | ✅ | ✅ | ✅ | ❌ | -| @-symbol | ✅ | ❌ | ✅ | ❌ | -| Ollama support (experimental) | ✅ | ✅ | ❌ | ❌ | -| LLM Selection | ✅ | ✅ | ✅ | ❌ | -| **Context Selection** | | | | | -| Single-repo context | ✅ | ✅ | ✅ | ❌ | -| Multi-repo context | ❌ | ❌ | ✅ (public code only) | ❌ | -| Local context | ✅ | ✅ | ❌ | ✅ | -| OpenCtx context providers (experimental) | ✅ | ❌ | ❌ | ❌ | -| **Prompts and Commands** | | | | -| Access to prompts and Prompt library | ✅ | ✅ | ✅ | ❌ | -| Custom commands | ✅ | ❌ | ❌ | ❌ | -| Edit code | ✅ | ✅ | ❌ | ❌ | -| Generate unit test | ✅ | ✅ | ❌ | ❌ | -| Ask Cody to Fix | ✅ | ✅ | ❌ | ❌ | +| **Feature** | **VS Code** | **JetBrains** | **Web** | **Visual Studio** | **CLI** | +| ---------------------------------------- | ----------- | ------------- | -------------------- | ----------------- | ------- | +| Chat with Cody | ✅ | ✅ | ✅ | ✅ | ✅ | +| Chat history | ✅ | ✅ | ✅ | ✅ | ❌ | +| Clear chat history | ✅ | ✅ | ✅ | ✅ | ❌ | +| Edit sent messages | ✅ | ❌ | ✅ | ✅ | ❌ | +| Show context files | ✅ | ✅ | ✅ | ✅ | ❌ | +| @-file | ✅ | ✅ | ✅ | ✅ | ❌ | +| @-symbol | ✅ | ❌ | ✅ | ✅ | ❌ | +| Ollama support (experimental) | ✅ | ✅ | ❌ | ✅ | ❌ | +| LLM Selection | ✅ | ✅ | ✅ | ✅ | ❌ | +| **Context Selection** | | | | | | +| Single-repo context | ✅ | ✅ | ✅ | ✅ | ❌ | +| Multi-repo context | ❌ | ❌ | ✅ (public code only) | ❌ | ❌ | +| Local context | ✅ | ✅ | ❌ | ✅ | ✅ | +| OpenCtx context providers (experimental) | ✅ | ❌ | ❌ | ❌ | ❌ | +| **Prompts and Commands** | | | | | | +| Access to prompts and Prompt library | ✅ | ✅ | ✅ | ✅ | ❌ | +| Edit code | ✅ | ✅ | ❌ | ❌ | ❌ | +| Generate unit test | ✅ | ✅ | ❌ | ❌ | ❌ | +| Ask Cody to Fix | ✅ | ✅ | ❌ | ❌ | ❌ | ## Code Autocomplete @@ -46,10 +45,10 @@ Few exceptions that apply to Cody Pro and Cody Enterprise users: -- Admin LLM selection is suported on VS Code, JetBrains, and Web both for chat and code autocomplete -- Multi-repo context is supported on VS Code, JetBrains, and Web +- Admin LLM selection is suported on VS Code, JetBrains, Visual Studio, and Web both for chat and code autocomplete +- Multi-repo context is supported on VS Code, JetBrains, Visual Studio, and Web - [Guardrails](/cody/clients/enable-cody-enterprise#guardrails) are supported on VS Code, JetBrains, and Web - [Repo-based Cody Context Filters](/cody/capabilities/ignore-context#cody-context-filters) are supported on VS Code, JetBrains, and Web -- `@-mention` directories are supported on VS Code, JetBrains, and Web +- `@-mention` directories are supported on VS Code, JetBrains, Visual Studio, and Web diff --git a/docs/cody/clients/install-visual-studio.mdx b/docs/cody/clients/install-visual-studio.mdx new file mode 100644 index 000000000..b18d89235 --- /dev/null +++ b/docs/cody/clients/install-visual-studio.mdx @@ -0,0 +1,77 @@ +# Installing Cody in Visual Studio + +

Learn how to use Cody and its features with the Visual Studio editor.

+ +Cody for Visual Studio is currently in the Experimental stage and currently only supports chat. + +Cody extension for Visual Studio enhances your coding experience by providing intelligent and contextually aware answers to your questions. This guide will walk you through installing and setting Cody within your Visual Studio editor. + + + + + +## Prerequisites + +- You have the latest version of [Visual Studio](https://visualstudio.microsoft.com/) installed +- You have a Free or Pro account via Sourcegraph.com or a Sourcegraph Enterprise account + +## Install the Visual Studio extension + +- Download the Cody extension for Visual Studio from the [GitHub repository](https://github.com/sourcegraph/cody-vs/releases) +- Run the installer and follow the prompts to install the extension +- Once installed, go to the **Extensions > Manage Extensions** tab in Visual Studio and search for Cody under the **Installed** list for confirmation + +## Connect the extension to Sourcegraph + +Cody for Visual Studio is available for all Cody plans, including Cody Free, Pro, and Enterprise. + +After a successful installation, go to **Tools** from the main toolbar at the top and click the **Cody Chat** from the drop-down. This opens the dialog box to connect to your Sourcegraph instance. + +Cody Free or Pro users can sign in to their Sourcegraph.com accounts through GitHub, GitLab, or Google. Meanwhile, Sourcegraph Enterprise users should connect Cody via their Enterprise instance URL and the Access Token. + +Complete these steps, and you'll be ready to start using Cody in Visual Studio. + +![install-cody-vscode](https://storage.googleapis.com/sourcegraph-assets/Docs/cody-vs-setup-102024-2.png) + +## Chat + +Cody in Visual Studio allows you to ask questions about your code and get contextually aware answers. The chat window is available in a unified interface next to your code. All your previous and existing chats are stored for later use and can be accessed via the **History** icon from the top menu. You can download them to share or use later in a `.json` file or delete them. + +The chat input field has a default `@-mention` [context chips](#context-retrieval). These are automatically populated with the names of the files you have open in your editor. There is also a drop-down for [LLM selection](#llm-selection) and a button to run pre-built [prompts and commands](#prompts). + +![cody-vs-chat](https://storage.googleapis.com/sourcegraph-assets/Docs/cody-visual-studio-1024.png) + +## LLM selection + +Cody offers a variety of large language models (LLMs) to power your chat experience. Cody Pro users can select the LLM they want to use for chat and experiment to choose the best model for the job. Choose from Claude 3.5 Sonnet, Claude 3 Opus, Claude 3 Sonnet, Claude 3 Haiku, GPT-4o, GPT-4 Turbo, GPT-3.5 Turbo, Google Gemini 1.5 Pro, Gemini 1.5 Flash, and Mixtral, while Cody Free users have access to the latest base models from Anthropic, OpenAI, Google, and Mixtral. + +Local models are also available through Ollama to Cody Free and Cody Pro users. To use a model in Cody chat, simply download it and run it in Ollama. + +Administrators for Sourcegraph Enterprise instances can also choose between Claude and GPT models to set for their teams. + +## Selecting Context with @-mentions + +Cody's chat allows you to add files and symbols as context in your messages. + +- Type `@-file` and then a filename to include a file as a context +- Type `@#` and then a symbol name to include the symbol's definition as context. Functions, methods, classes, types, etc., are all symbols + +![cody-vs-context-retrieval](https://storage.googleapis.com/sourcegraph-assets/Docs/cody-vs-mention-102024-2.png) + +### Context retrieval + +When you start a new Cody chat, the chat input window opens with a default `@-mention` context chips for all the context it intends to use. This context is based on your current repository and current file (or a file selection if you have code highlighted). + +At any point in time, you can edit these context chips or remove them completely if you do not want to use these as context. Any chat without a context chip will instruct Cody to use no codebase context. However, you can always provide an alternate `@-mention` file or symbols to let Cody use it as a new context source. + +When you have both a repository and files @-mentioned, Cody will search the repository for context while prioritizing the mentioned files. + +## Prompts + +Cody offers a variety of pre-built prompts and commands to help you get the most out of your chat experience. You can access these prompts and commands from the chat input field. Using one of these, you can ask Cody to: + +- Edit your code +- Document your code +- Generate unit tests + +![cody-vs-prompts](https://storage.googleapis.com/sourcegraph-assets/Docs/cody-vs-prompts-102024-2.png) diff --git a/docs/cody/index.mdx b/docs/cody/index.mdx index fe7fcdb26..924369456 100644 --- a/docs/cody/index.mdx +++ b/docs/cody/index.mdx @@ -17,8 +17,9 @@ Cody connects seamlessly with codehosts like + + diff --git a/src/data/navigation.ts b/src/data/navigation.ts index 0a70c1909..56d86bf1c 100644 --- a/src/data/navigation.ts +++ b/src/data/navigation.ts @@ -36,6 +36,7 @@ export const navigation: NavigationItem[] = [ subsections: [ { title: "Cody for VS Code", href: "/cody/clients/install-vscode", }, { title: "Cody for JetBrains", href: "/cody/clients/install-jetbrains", }, + { title: "Cody for Visual Studio", href: "/cody/clients/install-visual-studio", }, { title: "Cody for Web", href: "/cody/clients/cody-with-sourcegraph", }, { title: "Cody for Enterprise", href: "/cody/clients/enable-cody-enterprise", }, { title: "Model Configuration", href: "/cody/clients/model-configuration", },