The Sourcegraph plugin for JetBrains IDEs enables you to quickly open and search code on Sourcegraph easily and efficiently in JetBrains IDEs such as IntelliJ. This plugin works with most JetBrains IDEs:
- IntelliJ IDEA
- IntelliJ IDEA Community Edition
- PhpStorm
- WebStorm
- PyCharm
- PyCharm Community Edition
- RubyMine
- AppCode
- CLion
- GoLand
- DataGrip
- Rider
- Android Studio
- Select
IntelliJ IDEA
thenPreferences
(or use ⌘,) - Click
Plugins
in the left-hand pane. - Choose
Browse repositories...
- Search for
Sourcegraph
->Install
Right click any code or selection and choose Sourcegraph: Open
or Sourcegraph: Search
.
Keyboard Shortcuts:
Description | Mac | Linux / Windows |
---|---|---|
Open file in Sourcegraph | Option+A | Alt+A |
Search selection in Sourcegraph | Option+S | Alt+S |
The plugin is configurable by creating a sourcegraph-jetbrains.properties
in your home directory. For example, modify the following URL to match your on-premises Sourcegraph instance URL:
url = https://sourcegraph.com
By default, the plugin will use the origin
git remote to determine which repository on Sourcegraph corresponds to the local repository. You may configure this by adding a sourcegraph
remote which will take priority.
Please file an issue: https://github.com/sourcegraph/sourcegraph-jetbrains/issues/new
- Select
IntelliJ IDEA
thenPreferences
(or use ⌘,) - Click
Plugins
in the left-hand pane. - Search for
Sourcegraph
-> Right click ->Uninstall
(or uncheck to disable)
- Start IntelliJ and choose
Check out from Version Control
->Git
->https://github.com/sourcegraph/sourcegraph-jetbrains
- Develop as you would normally (hit Debug icon in top right of IntelliJ).
- To create
sourcegraph.jar
:- Update
plugin.xml
(change version AND describe changes in change notes). - Update
Util.java
(changeVERSION
constant). - Update
README.md
(copy changelog from plugin.xml). - choose
Build
->Prepare Plugin Module 'sourcegraph' For Deployment
git commit -m "all: release v<THE VERSION>"
andgit push
andgit tag v<THE VERSION>
andgit push --tags
- Publish according to http://www.jetbrains.org/intellij/sdk/docs/basics/getting_started/publishing_plugin.html (note: it takes ~2 business days for JetBrains support team to review the plugin).
- Update
- Fixed an error that occurred when trying to search with no selection.
- The git remote used for repository detection is now
sourcegraph
and thenorigin
, instead of the previously poor choice of just the first git remote.
- Fixed search shortcut; Updated the search URL to reflect a recent Sourcegraph.com change.
- Added support for using the plugin with on-premises Sourcegraph instances.
- Initial Release; basic Open File & Search functionality.