General Introduction
Sourcegraph is a code intelligence platform that helps developers search, understand and write code in complex code bases. Through code search and context-aware AI, developers can perform code review, problem troubleshooting and knowledge sharing more efficiently, significantly improving development efficiency and code quality to solve complex software problems. Whether it's an open source project or an in-house codebase, Sourcegraph provides powerful code search and navigation capabilities to improve development efficiency.
Function List
- Code Search: Find code quickly in any code host, language or code base.
- Code Navigation: Easily navigate and understand code structure and quickly locate function and variable definitions.
- AI Assistant Cody: Use the latest AI models and codebase contexts to help generate and edit code.
- Automated workflows: Automate common tasks such as generating unit tests, modernizing code and documentation with custom prompts.
- Code Trend Tracking: Transform code into a queryable database to create custom dashboards.
- Enterprise Edition: Provides additional security, scalability and control for large organizations.
Using Help
Installation process
- Installing Browser Extensions::
- Visit the Sourcegraph website to download and install the browser extension for Chrome or Firefox.
- Once installed, the browser address bar will be automatically configured to use Sourcegraph for code searching.
- Configuring the search engine::
- In Chrome, go to the Settings page and add Sourcegraph as a search engine.
- In Firefox, click on the three-dot menu on the right side of the address bar and select "Add Search Engine".
Usage Process
- Code Search::
- In the address bar of your browser, type
src
Presstab
key, and then enter a search query. - press a button
Enter
key, the browser will jump to the search result page of Sourcegraph.
- In the address bar of your browser, type
- Code Navigation::
- On the Sourcegraph search results page, click on any code snippet to see details.
- Use the navigation bar to quickly jump to function definitions, variable declarations, or related documentation.
- Using the AI assistant Cody::
- In the code editor, launch the Cody plugin.
- Enter a natural language prompt and Cody will generate code suggestions based on the context.
- Use Cody's auto-completion feature to speed up code writing.
- Automated workflows::
- Create and customize prompts in Sourcegraph to automate common development tasks.
- For example, generating unit tests, updating documentation, or modernizing code.
- Code Trend Tracking::
- Convert the code base into a queryable database to create custom dashboards.
- Track changes and trends in the code base in real time to quickly identify potential problems.
Detailed operating instructions
- Code Search: Enter a keyword in the search field of Sourcegraph and click the Search button. The result page will show all matching code snippets, click on any result to see details.
- Code Navigation: In the results page, use the navigation bar to quickly jump to the relevant code snippet. Click on a function or variable name to see its definition and usage.
- AI assistant, Cody.: In the code editor, launch the Cody plugin. Enter natural language hints and Cody will generate code suggestions based on the context. Use auto-completion to speed up code writing.
- Automated workflows: Create and customize prompts in Sourcegraph to automate common development tasks. For example, generating unit tests, updating documentation, or modernizing code.
- Code Trend Tracking: Transform the codebase into a queryable database to create customized dashboards. Track changes and trends in the codebase in real time to quickly identify potential problems.