You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/code-search/code-navigation/search_based_code_navigation.mdx
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
# Search-based Code Navigation
2
2
3
3
<TierCallout>
4
-
Supported on [Enterprise Starter](/pricing/enterprise-starter) and [Enterprise](/pricing/enterprise) plans.
4
+
Supported on [Enterprise](/pricing/enterprise) plans.
5
5
<user>
6
6
Available via VS Code and JetBrains editor extensions and the Web.
7
7
</user>
@@ -49,5 +49,5 @@ The default values for these environment variables come from [`config.go`](https
49
49
## More resources
50
50
51
51
<LinkCards>
52
-
<LinkCardhref="/code-search/code-navigation/rockskip"imgSrc="https://sourcegraph.com/.assets/img/sourcegraph-mark.svg"imgAlt="Rockskip"title="Rockskip: Symbol sidebar and search navigation"description="Enhances symbol sidebar and search-based code navigation experience in large monorepos." />
52
+
<LinkCardhref="/code-search/code-navigation/rockskip"imgSrc="https://storage.googleapis.com/sourcegraph-assets/Docs/sg-new-logo.svg"imgAlt="Rockskip"title="Rockskip: Symbol sidebar and search navigation"description="Enhances symbol sidebar and search-based code navigation experience in large monorepos." />
Copy file name to clipboardExpand all lines: docs/code-search/working/saved_searches.mdx
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ Saved Searches lets you reuse and share search queries. You can create a saved s
6
6
7
7
Saved Searches functionality is available to both Free and Enterprise Code Search users. To access or create new Saved Searches in the Sourcegraph web app, click the **Tools > Saved Searches** in the top navigation bar.
A `patternType:` filter is required in the query for all saved searches. `patternType` can be `keyword`, `standard`, `literal`, or `regexp`. You cannot create a saved search without defining the `patternType:` field.
Enable the checkbox for **Draft** if you don't want other users to use your saved search. This is useful for testing the query before sharing it with others. Once done, click the **Create saved search** button to be redirected to the Saved Searches page.
24
24
@@ -32,7 +32,7 @@ In addition, you can also search within your saved searches and sort your saved
32
32
33
33
To transfer ownership of a saved search, click the **Edit** button next to it, click the **Transfer ownership** button, and select the organization to which you want to transfer the saved search.
<pclassName="subtitle">Use Cody's chat to get contextually-aware answers to your questions.</p>
3
+
<pclassName="subtitle">Chat with the AI assistant in your code editor or via the Sourcegraph web app to get intelligent suggestions, code autocompletions, and contextually aware answers.</p>
4
4
5
-
You can **chat** with Cody to ask questions about your code, generate code, and edit code. By default, Cody has the context of your open file and entire repository, and you can use `@` to add context for specific files, symbols, remote repositories, or other non-code artifacts.
5
+
<Tabs>
6
+
<Tabtitle="Free/Pro">
7
+
You can **chat** with Cody to ask questions about your code, generate code, and edit code. By default, Cody has the context of your open file and entire repository, and you can use `@` to add context for specific files, symbols, remote repositories, or other non-code artifacts.
6
8
7
9
You can do it from the **chat** panel of the supported editor extensions ([VS Code](/cody/clients/install-vscode), [JetBrains](/cody/clients/install-jetbrains), [Visual Studio](/cody/clients/install-visual-studio), [Eclispe](/cody/clients/install-eclipse)) or in the [web](/cody/clients/cody-with-sourcegraph) app.
8
10
9
11
## Prerequisites
10
12
11
13
To use Cody's chat, you'll need the following:
12
14
13
-
-A Free or Pro account via Sourcegraph.com or a Sourcegraph Enterprise account
-[Sourcegraph Enterprise Starter](https://sourcegraph.com/pricing) or [Enterprise account](https://sourcegraph.com/pricing)
16
+
- A supported editor extension [VS Code](https://marketplace.visualstudio.com/items?itemName=sourcegraph.cody-ai), [JetBrains](https://plugins.jetbrains.com/plugin/9682-cody-ai-coding-assistant-with-autocomplete--chat) installed or use via Web app
15
17
16
18
## How does chat work?
17
19
@@ -31,7 +33,7 @@ There are several features that you can use to make your chat experience better.
31
33
32
34
When you start a new Cody chat, the input window opens with a default `@-mention` context chips for the opened file and the current repository.
At any point in time, you can edit these context chips or remove them entirely 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.
37
39
@@ -43,7 +45,7 @@ You can add new custom context by adding `@-mention` context chips to the chat.
43
45
44
46
## OpenCtx context providers
45
47
46
-
<Callouttype="info">OpenCtx context providers are in the Experimental stage for all Cody VS Code users. Enterprise users can also use this, but with limited support. If you have feedback or questions, please visit our [support forum](https://community.sourcegraph.com/c/openctx/10).</Callout>
48
+
<Callouttype="info">OpenCtx context providers are in the Experimental stage for all Cody VS Code users. Enterprise users can also use this but with limited support. If you have feedback or questions, please visit our [support forum](https://community.sourcegraph.com/c/openctx/10).</Callout>
47
49
48
50
[OpenCtx](https://openctx.org/) is an open standard for bringing contextual info about code into your dev tools. Cody Free and Pro users can use OpenCtx providers to fetch and use context from the following sources:
49
51
@@ -68,19 +70,19 @@ You can still switch to your Sourcegraph account whenever you want to use Claude
68
70
69
71
## LLM selection
70
72
71
-
Cody allows you to select the LLM you want to use for your chat, optimized for speed versus accuracy. Cody Free and Pro users can select multiple models. Enterprise users with the new [model configuration](/cody/clients/model-configuration) can use the LLM selection dropdown to choose a chat model.
73
+
Cody allows you to select the LLM you want to use for your chat, which is optimized for speed versus accuracy. Cody Free and Pro users can select multiple models. Enterprise users with the new [model configuration](/cody/clients/model-configuration) can use the LLM selection dropdown to choose a chat model.
72
74
73
75
You can read about these supported LLM models [here](/cody/capabilities/supported-models#chat-and-commands).
Cody lets you dynamically insert code from chat into your files with **Smart Apply**. Whenever Cody provides a code suggestion, you can click the **Apply** button. Cody will then analyze your open code file, find where that relevant code should live, and add a diff. For chat messages where Cody provides multiple code suggestions, you can apply each in sequence to go from chat suggestions to written code.
80
82
81
83
Smart Apply also supports the executing of commands in the terminal. When you ask Cody a question related to terminal commands, you can now execute the suggestion in your terminal by clicking the `Execute` button in the chat window.
@@ -103,5 +105,95 @@ You are provided with code suggestions in the chat window and the following opti
103
105
If Cody's answer isn't helpful, you can try asking again with a different context:
104
106
105
107
-**Public knowledge only**: Cody will not use your own code files as context; it’ll only use knowledge trained into the base model.
106
-
-**Current file only**: Re-run the prompt again using just the current file as context.
108
+
-**Current file only**: Re-run the prompt again using the current file as context.
107
109
-**Add context**: Provides @-mention context options to improve the response by explicitly including files, symbols, remote repositories, or even web pages (by URL).
110
+
</Tab>
111
+
<Tabtitle="Enterprise Starter/Enterprise">
112
+
113
+
The enhanced chat experience input can be accessed from the chat panel of the supported editor extensions (VS Code and JetBrains) and the web app. It combines light code search, AI-powered chat, and agentic capabilities into a unified developer interface. It's designed to accelerate the entire developer workflow by providing a more intuitive and powerful way to interact with code.
114
+
115
+
## Prerequisites
116
+
117
+
To use Cody's chat, you'll need the following:
118
+
119
+
-[Sourcegraph Enterprise Starter](https://sourcegraph.com/pricing) or [Enterprise account](https://sourcegraph.com/pricing)
120
+
- A supported editor extension [VS Code](https://marketplace.visualstudio.com/items?itemName=sourcegraph.cody-ai), [JetBrains](https://plugins.jetbrains.com/plugin/9682-cody-ai-coding-assistant-with-autocomplete--chat) installed or use via Web app
121
+
122
+
## Key features
123
+
124
+
The enhanced chat experience includes everything in the Free plan, plus the following:
125
+
126
+
## Intent detection
127
+
128
+
Intent detection automatically analyzes user queries and determines whether to provide an AI chat or code search response. This functionality helps simplify developer workflows by providing the most appropriate type of response without requiring explicit mode switching.
129
+
130
+
### How it works
131
+
132
+
When a user submits a query in the chat panel, the intent detection component:
133
+
134
+
- Analyzes the query content and structure
135
+
- Determines the most appropriate response type (search or chat)
136
+
- Returns results in the optimal format
137
+
- Provides the ability to toggle between response types manually
The smart search integration enhances Sourcegraph's chat experience by providing lightweight code search capabilities directly within the chat interface. This feature simplifies developer workflows by offering quick access to code search without leaving the chat environment.
152
+
153
+
The integration delivers personalized search results ranked by your contribution history, with frequently accessed repositories appearing higher in results. Users can view code snippets with relevant context and open files directly in their editor.
154
+
155
+
Search results automatically become available as context for follow-up queries, with flexible controls for selecting which results to include. While optimized for keyword-style queries and searching across a few repositories, this integration complements rather than replaces the full [Code Search](/code-search) product, which remains the recommended tool for comprehensive enterprise-wide code search.
156
+
157
+
## Context-aware responses
158
+
159
+
Search results generated through smart search integration can be automatically used as context for follow-up queries. Here's what happens with each scenario:
160
+
161
+
### Search responses
162
+
163
+
* Search results can be used directly as context for follow-up queries
164
+
* Users can select which search results to include as context using checkboxes
165
+
* By default, all search results are added as context
166
+
* A context chip shows the number of search results being used (e.g., "10 code search results")
167
+
* Users can remove the context chip if they don't want to use it for follow-ups
168
+
169
+
### Chat responses
170
+
171
+
<Callouttype="info">Executing terminal commands for additional context is an experimental feature.</Callout>
172
+
173
+
* Performs background searches for context
174
+
* Retrieves full context from files, symbols, remote repos, and web pages
175
+
* Can execute terminal commands (with permission) for additional context
176
+
* Creates personal notes usable across chat sessions
177
+
* Pulls in [OpenCtx](/cody/capabilities/openctx) providers for additional context
178
+
179
+
## How does chat work?
180
+
181
+
The following is a general walkthrough of the chat experience:
182
+
183
+
1. The user enters a query in the chat interface
184
+
2. The system analyzes the query through intent detection
185
+
3. If it's a search query:
186
+
- Displays ranked results with code snippets
187
+
- Shows personalized repository ordering
188
+
- Provides checkboxes to select context for follow-ups
189
+
4. If it's a chat query:
190
+
- Delivers AI-powered responses
191
+
- Can incorporate previous search results as context
192
+
5. Users can:
193
+
- Switch between search and chat modes
194
+
- Click on results to open files in their editor
195
+
- Ask follow-up questions using selected context
196
+
- Use `@` to add context for specific files, symbols, remote repositories, or other non-code artifacts
@@ -37,15 +37,15 @@ Click the **New prompt** button from the **Prompt Library** page.
37
37
- Select the **Owner** and **Prompt Name**
38
38
- Write a prompt description
39
39
- Next, fill out the **Prompt template** box with all your prompt instructions
40
-
- You can also `@` mention [specific and dynamic context](#specific-and-dynamic-context) that will allow your prompt to use content from different sources like current selection and current file
40
+
- You can also add dynamic context that will allow your prompt to use content from different sources like current selection and current file
41
41
- Select the visibility of the prompt, either **Public** or **Private**
42
42
- You can mark your prompt as **draft**. Draft prompts are not visible to other users until you publish it
43
43
- Choose the mode of the prompt, whether it will be **Chat only** or can **Edit code**
44
44
- Once done, click the **Create prompt** button
45
45
46
46
There are also a few advanced options that you can configure.
Once created, it will appear in the **Tags** list and in the sidebar of the Prompt Library. To manage your prompt tags, you can **edit**, **delete**, or **copy link to prompts with this tag**.
84
84
85
85
### Assigning tags to prompts
86
86
87
87
Once site admins create tags, other users in your organization can assign tags to their prompts. While creating or editing a prompt, there is a drop-down selector **Add prompt to...** to assign tags to the prompt.
You can assign multiple tags to a prompt and group them based on their functionality, category, or any other criteria for your organization. In addition, with tags assigned to prompts, you can filter prompts by tags in the Prompt Library.
92
92
93
-
## Specific and dynamic context (beta)
94
-
95
-
<Callouttype="info">Sourcegraph 6.0 adds beta support for the `@` mention menu in the prompt library.</Callout>
96
-
97
-
When writing prompts, you can leverage both specific and dynamic context through the `@` mention system.
98
-
99
-

100
-
101
-
Type `@` to open a dropdown menu that lets you reference specific context like symbols, directories, files, repositories and web URLs.
102
-
103
-
When selecting a web URL, type out the domain, including the `https://` prefix, for example, https://sourcegraph.com.
104
-
105
-
For dynamic context that adapts based on what the user is working on, the prompt editor provides special mentions for the current selection, current file, current repository, current directory, and open tabs.
106
-
When a user runs a prompt template containing dynamic context mentions, they are automatically resolved to the appropriate specific context based on the user's current workspace state.
107
-
To add dynamic context, click on one of the buttons below the prompt editor. We will soon move the buttons into the `@` mention menu as well.
108
-
109
-
This powerful combination allows prompt authors to create templates that can intelligently access both explicitly defined context and contextually relevant information at runtime.
110
-
111
93
## Run prompts
112
94
113
95
You can run prompts via:
@@ -117,13 +99,15 @@ You can run prompts via:
117
99
118
100
However, prompts marked with the **Edit code** mode can only run from the IDE editor. You cannot run these prompts from the Prompt Library in the web UI. For example, the **document-code** built-in prompt can only run the IDE editor.
<Callouttype="note">Promoted prompts are supported in VS Code and Cody Web.</Callout>
123
107
124
108
**Site admins** can promote a prompt by enabling the **Promote prompt** checkbox. This setting allows admins to highlight prompts they want users to use. Promoted prompts are marked with an icon next to their name and appear at the top of the prompt list in the Cody chat.
0 commit comments