diff --git a/.gitignore b/.gitignore
index a5d4cc8..896c55f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,8 @@
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
+*.jar
+
# User-specific stuff:
.idea/**/workspace.xml
.idea/**/tasks.xml
diff --git a/.idea/misc.xml b/.idea/misc.xml
index 55b0f50..91a4741 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -38,7 +38,7 @@
-
+
\ No newline at end of file
diff --git a/README.md b/README.md
index 84a3af2..b76ceef 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,10 @@
# Sourcegraph for JetBrains IDEs [](https://plugins.jetbrains.com/plugin/9682-sourcegraph)
-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:
+- Search snippets of code on Sourcegraph.
+- Copy and share a link to code on Sourcegraph.
+- Quickly go from files in your editor to Sourcegraph.
+
+The plugin works with all JetBrains IDEs including:
- IntelliJ IDEA
- IntelliJ IDEA Community Edition
@@ -16,49 +20,45 @@ The Sourcegraph plugin for JetBrains IDEs enables you to quickly open and search
- Rider
- Android Studio
-
## Installation
- Select `IntelliJ IDEA` then `Preferences` (or use ⌘,)
- Click `Plugins` in the left-hand pane.
- Choose `Browse repositories...`
- Search for `Sourcegraph` -> `Install`
+- Restart your IDE if needed, then select some code and choose `Sourcegraph` in the right-click context menu to see actions and keyboard shortcuts.
+## Configuring for use with a private Sourcegraph instance
-## Usage
-
-Right click any code or selection and choose `Sourcegraph: Open` or `Sourcegraph: Search`.
-
-Keyboard Shortcuts:
+The plugin is configurable _globally_ by creating a `sourcegraph-jetbrains.properties` in your home directory. For example, modify the following URL to match your on-premises Sourcegraph instance URL:
-| Description | Mac | Linux / Windows |
-|---------------------------------|---------------------|------------------|
-| Open file in Sourcegraph | Option+A | Alt+A |
-| Search selection in Sourcegraph | Option+S | Alt+S |
-
-
-## Settings
+```
+url = https://sourcegraph.example.com
+```
-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:
+You may also choose to configure it _per repository_ using a `.idea/sourcegraph.xml` file in your repository like so:
-```
-url = https://sourcegraph.com
+```xml
+
+
+
+
+
+
```
-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.
+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.
## Questions & Feedback
Please file an issue: https://github.com/sourcegraph/sourcegraph-jetbrains/issues/new
-
## Uninstallation
- Select `IntelliJ IDEA` then `Preferences` (or use ⌘,)
- Click `Plugins` in the left-hand pane.
- Search for `Sourcegraph` -> Right click -> `Uninstall` (or uncheck to disable)
-
## Development
- Start IntelliJ and choose `Check out from Version Control` -> `Git` -> `https://github.com/sourcegraph/sourcegraph-jetbrains`
@@ -67,13 +67,23 @@ Please file an issue: https://github.com/sourcegraph/sourcegraph-jetbrains/issue
1. Update `plugin.xml` (change version AND describe changes in change notes).
2. Update `Util.java` (change `VERSION` constant).
3. Update `README.md` (copy changelog from plugin.xml).
- 5. choose `Build` -> `Prepare Plugin Module 'sourcegraph' For Deployment`
- 6. `git commit -m "all: release v"` and `git push` and `git tag v` and `git push --tags`
+ 4. choose `Build` -> `Prepare Plugin Module 'sourcegraph' For Deployment`
+ 5. `git commit -m "all: release v"` and `git push` and `git tag v` and `git push --tags`
+ 6. Upload the jar to the releases tab of this repository.
7. 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).
-
## Version History
+#### v1.2.0
+
+- The search menu entry is now no longer present when no text has been selected.
+- When on a branch that does not exist remotely, `master` will now be used instead.
+- Menu entries (Open file, etc.) are now under a Sourcegraph sub-menu.
+- Added a "Copy link to file" action (alt+c / opt+c).
+- Added a "Search in repository" action (alt+r / opt+r).
+- It is now possible to configure the plugin per-repository using a `.idea/sourcegraph.xml` file. See the README for details.
+- Special thanks: @oliviernotteghem for contributing the new features in this release!
+
#### v1.1.2
- Fixed an error that occurred when trying to search with no selection.
diff --git a/resources/META-INF/plugin.xml b/resources/META-INF/plugin.xml
index 85b8128..4b95bc1 100644
--- a/resources/META-INF/plugin.xml
+++ b/resources/META-INF/plugin.xml
@@ -1,20 +1,34 @@
com.sourcegraph.jetbrainsSourcegraph
- 1.1.2
+ 1.2.0Sourcegraph
+
+
Search snippets of code on Sourcegraph.
+
Copy and share a link to code on Sourcegraph.
+
Quickly go from files in your editor to Sourcegraph.
+
]]>
-
v1.1.2 - Minor bug fixes around searching.
-
-
Fixed an error that occurred when trying to search with no selection.
+
v1.2.0 - Copy link to file, search in repository, per-repository configuration, bug fixes & more
+
+
The search menu entry is now no longer present when no text has been selected.
+
When on a branch that does not exist remotely, `master` will now be used instead.
+
Menu entries (Open file, etc.) are now under a Sourcegraph sub-menu.
+
Added a "Copy link to file" action (alt+c / opt+c).
+
Added a "Search in repository" action (alt+r / opt+r).
+
It is now possible to configure the plugin per-repository using a `.idea/sourcegraph.xml` file. See the README for details.
+
Special thanks: @oliviernotteghem for contributing the new features in this release!
+
+
v1.1.2 - Minor bug fixes around searching.
+
Fixed an error that occurred when trying to search with no selection.
The git remote used for repository detection is now `sourcegraph` and then `origin`, instead of the previously poor choice of just the first git remote.