Sourcegraph for JetBrains IDEs (IntelliJ)
⚠️ Development of the JetBrains plugin has moved to sourcegraph/jetbrains
.
The plugin works with all JetBrains IDEs including:
IntelliJ IDEA
then Preferences
(or use ⌘,)Plugins
in the left-hand pane.Browse repositories...
Sourcegraph
-> Install
Sourcegraph
in the right-click context menu to see actions and keyboard shortcuts.The plugin is configurable globally by creating a .sourcegraph-jetbrains.properties
(or sourcegraph-jetbrains.properties
pre-v1.2.2) in your home directory. For example, modify the following URL to match your on-premises Sourcegraph instance URL:
url = https://sourcegraph.example.com
defaultBranch = example-branch
remoteUrlReplacements = git.example.com, git-web.example.com
You may also choose to configure it per repository using a .idea/sourcegraph.xml
(or idea/sourcegraph.xml
pre-v1.2.2) file in your repository like so:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="com.sourcegraph.project.SourcegraphConfig">
<option name="url" value="https://sourcegraph.example.com"/>
<option name="defaultBranch" value="example-branch"/>
<option name="remoteUrlReplacements" value="git.example.com, git-web.example.com"/>
</component>
</project>
By default, the plugin will use the origin
git remote to determine which repository on Sourcegraph corresponds to your local repository. If your origin
remote doesn't match Sourcegraph, you may instead configure a sourcegraph
Git remote which will take priority.
Please file an issue: https://github.com/sourcegraph/sourcegraph-jetbrains/issues/new
IntelliJ IDEA
then Preferences
(or use ⌘,)Plugins
in the left-hand pane.Sourcegraph
-> Right click -> Uninstall
(or uncheck to disable)Check out from Version Control
-> Git
-> https://github.com/sourcegraph/sourcegraph-jetbrains
./gradlew runIde
to run an IDE instance with sourcegraph plugin installed. This will start the platform with the versions defined in gradle.properties
. Note: 2021.3 is required for M1 Macs.
./gradlew buildPlugin
to build plugin artifact (build/distributions/Sourcegraph.zip
)The publishing process is based on the actions outlined in the intellij-platform-plugin-template
.
gradle.properties
and set the version number for this release (e.g. 1.2.3
).v1.2.3
).[Unreleased]
section of the CHANGELOG.md
into the GitHub release text.See CHANGELOG.md
.