Skip to content
This repository was archived by the owner on Nov 14, 2023. It is now read-only.

Conversation

@oliviernotteghem
Copy link
Contributor

  • Disable search menu entry when no text is selected.
  • Fix handling of local branch
  • Move menu entries into sub-menu
  • Implement copy link functionality
  • Use Project storage API to load config from

- Fix handling of local branch
- Move menu entries into sub-menu
- Implement copy link functionality
- Use Project storage API to load config from
@emidoots
Copy link
Member

Apologies for the delay on this, I’ll review and merge soon!

@emidoots
Copy link
Member

Thanks for the PR @oliviernotteghem -- this is really cool, I especially like the icon and submenu! I pushed some minor changes here: #14

One problem with this approach.. I notice this doesn't appear in the editor preferences UI which is what #11 and #7 seem to indicate we should be doing.

It seems this just changes the configuration from a manual $HOME/sourcegraph-jetbrains.properties that one must write to a .idea/sourcegraph.xml that one must write (also with no nice uI or editor support)

I think we need to do something like this: http://corochann.com/intellij-plugin-development-introduction-applicationconfigurable-projectconfigurable-873.html#Making_classimplements_Configurable

I would merge this as-is, because the bug fixes are good, but one problem sticks out to me with this approach in particular:

.idea/sourcegraph.xml is in a single project only, while $HOME/sourcegraph-jetbrains.properties is at least global. Since most users will only interact with a single Sourcegraph instance, it seems bad to make them configure the Sourcegraph URL for each project. What do you think?

@oliviernotteghem
Copy link
Contributor Author

oliviernotteghem commented Apr 20, 2020 via email

@emidoots
Copy link
Member

Yeah, I'd love to! I could do the following times:

  • Tue 12 PM - 2 PM PST
  • Wed 11AM - 4PM PST

Do either of those work for you? If yes just send me an invite to stephen@sourcegraph.com

@emidoots
Copy link
Member

in brief, for search actions, the current repo is ignored, i.e it searches against the entire set of repo in sourcegrap.

I think we could solve this by having two actions: "Search" (global) and "Search in repository"

Only question is: could we come up with another keyboard shortcut that makes sense? Maybe Option+R ?

This change will also require a change on the Sourcegraph.com side so that repo:$THE_REPO gets added to the search query, but should be easy enough to do and I can make that.

@oliviernotteghem
Copy link
Contributor Author

oliviernotteghem commented Apr 20, 2020 via email

@emidoots
Copy link
Member

Hey @oliviernotteghem I am working on:

  • Adding the Search in repository action we mentioned, I am thinking alt+r as a shortcut for that -- any objection to that?
  • Do you have any example .idea/sourcegraph.xml configuration? I took a look for a few hours but wasn't able to decipher exactly what PersistentStateComponent<Config> expects - I am sure I am just missing something obvious here but could you give me a pointer?

@emidoots
Copy link
Member

emidoots commented May 4, 2020

@oliviernotteghem any chance you could take a quick look at my last message? I'd love to land this soon

@oliviernotteghem
Copy link
Contributor Author

Sorry, I somehow missed it. .idea/sourcegraph.xml will be generated automatically whenever you close project / IDE, provided you specific data. So just invoke setter (instead of getter) in your code, run it, close IDEA, and you should see the file.

for the shortcut key combo : sounds good to me.

emidoots pushed a commit to sourcegraph/sourcegraph-public-snapshot that referenced this pull request May 12, 2020
This adds support for editors having the following actions:

1. Search in repository
2. Search in repository@branch
3. Search in repository@rev
4. Search in file

In practice, I imagine only the first one will be used for now and later
someone may request support for 2/3/4. In specific, the first one will be
implemented in Jetbrains editors via sourcegraph/sourcegraph-jetbrains#13
emidoots pushed a commit to sourcegraph/sourcegraph-public-snapshot that referenced this pull request May 13, 2020
…repository" (#10586)

* editor: refactor HTTP handler for testing

* editor: add tests for editor HTTP handler

* editor: refactor HTTP handler to be more legible + fix bugs

* editor: produce proper ?patternType=literal URLs instead of using quotes-in-regexp-search

* add comment

* editor: add support for "search in repository/file"

This adds support for editors having the following actions:

1. Search in repository
2. Search in repository@branch
3. Search in repository@rev
4. Search in file

In practice, I imagine only the first one will be used for now and later
someone may request support for 2/3/4. In specific, the first one will be
implemented in Jetbrains editors via sourcegraph/sourcegraph-jetbrains#13

* Update cmd/frontend/internal/app/editor.go

Co-authored-by: ᴜɴᴋɴᴡᴏɴ <joe@sourcegraph.com>

* Update cmd/frontend/internal/app/editor.go

Co-authored-by: ᴜɴᴋɴᴡᴏɴ <joe@sourcegraph.com>

* Update cmd/frontend/internal/app/editor.go

Co-authored-by: ᴜɴᴋɴᴡᴏɴ <joe@sourcegraph.com>

* address comments

Co-authored-by: ᴜɴᴋɴᴡᴏɴ <joe@sourcegraph.com>
@emidoots
Copy link
Member

Merged via #14

@emidoots emidoots closed this Jun 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants