Sourcegraph for Visual Studio CodeSourcegraph’s Code Search allows you to find & fix things fast across all your code. Sourcegraph Search for VS Code allows you to search millions of open source repositories right from your VS Code IDE — for free. You can learn from helpful code examples, search best practices, and re-use code from millions of repositories across the open source universe. Sourcegraph’s Code Intelligence feature provides fast, cross-repository navigation with “Go to definition” and “Find references” features, allowing you to understand new code quickly and find answers in your code across codebases of any size. You can read more about Sourcegraph on our website. Not the extension you're looking for? Download the Sourcegraph Cody extension for code AI assistance. InstallationFrom the Visual Studio Marketplace:
From within VS Code:
From Gitpod VS Code Workspaces:
Using the Sourcegraph Search extensionTo get started, click the Sourcegraph (Wildcard) icon in the VS Code Activity Bar. You can search many open source repositories indexed on https://sourcegraph.com immediately! Sourcegraph Search functions like any search engine: type in your search query, and Sourcegraph will populate search results. Learn more about Sourcegraph Code Search usage in our docs. For example, you can search for "auth provider" in a Go repository with a search like this one:
Adding and searching your own codeIf you are part of an organization that has installed a Sourcegraph instance, you can authenticate to it using a Personal Access Token, and then your searches will use that instance. If you need help creating a Personal Access Token, the documentation has a helpful video. Once you have generated a token, copy it and paste it into the Sourcegraph Search extension along with the URL to your Sourcegraph instance. Click If specific headers are required to connect to your Sourcegraph instance, you can configure them in the VSCode settings using the There are other settings such as proxy details that you can set also. Search for "sourcegraph" in Settings to find them. Adding it to your workspace's recommended extensions
Alternatively you can use the Keyboard Shortcuts:
Extension SettingsThis extension contributes the following settings:
Questions & FeedbackFeedback and feature requests can be submitted to our Code Search discussion community. Uninstallation
ChangelogClick here to check the full changelog. VS Code will auto-update extensions to the highest version available. Even if you have opted into a pre-release version, you will be updated to the released version when a higher version is released. The Sourcegraph Search extension uses major.EVEN_NUMBER.patch (eg. 2.0.1) for release versions and major.ODD_NUMBER.patch (eg. 2.1.1) for pre-release versions.``` DevelopmentPlease see the CONTRIBUTING document if you are interested in contributing directly to our code base. |