top | item 14259463

Sourcegraph now running on an in-browser VS Code

216 points| MetalMatze | 8 years ago |sourcegraph.com | reply

82 comments

order
[+] sqs|8 years ago|reply
Sourcegraph CEO here. Thanks for posting! Our new VS Code-based UI makes Sourcegraph a better way for you to read a codebase on the web with the full power and intelligence of an editor, without the hassle of cloning or configuration. It provides jump-to-def, hovers, find references, advanced search, symbol search, cross-repo references, etc., for any repo and any commit on GitHub (in Go, Java, and some other languages...more coming soon).

If you find yourself reading code on GitHub a lot, or cloning repos to open and read in your editor, you'll find Sourcegraph useful. If not, then you probably won't find it useful yet, but you might like our Chrome extension, which adds these features inline on GitHub.com (https://chrome.google.com/webstore/detail/sourcegraph-for-gi...).

We'd love feedback. Try hovering over some tokens at https://sourcegraph.com/github.com/sourcegraph/checkup@maste..., for example. Click on the smiley in the bottom right to give feedback.

Huge thanks to the VS Code team for building an amazing and extensible open-source code editor that we can build on.

[+] m_fayer|8 years ago|reply
The product looks super useful, thanks for your efforts and congrats!

Your site is sorely lacking a good FAQ though. I just spent 10 minutes trying to figure out what languages you support, looking for a roadmap, trying to figure out if I can use this with any random repo on GitHub, and with which pricing plan. I only got the answers when I looked at the HN comments.

[+] neurocroc|8 years ago|reply
Is it possible to have something similar to this (http://youtubeonrepeat.com/youtube-repeat-button/) for Souregraph. I use Safari and there is no extension that allows me to instance view github repo in source graph.

Is it possible to use something to make this work?

[+] type0|8 years ago|reply
Great thing, never heard about Sourcegraph before, we will surely try it. What is your business plan for it looks like may I ask?
[+] rdubz|8 years ago|reply
Looks cool!

Mobile experience seems poor:

- Weird margins taking up lots of the screen

- Back button seems to be disabled (I pressed it about 200x trying to get back to HN and nothing happened)

- "view mode" would be nice: don't pop up keyboard for editing when I click on some part of a source file, but still support clicking symbols and offering options e.g. jump to definition.

[+] donpark|8 years ago|reply
opening a file takes too long, likely due to minimap. I'd disable expensive eye-candies by default.
[+] theptip|8 years ago|reply
Looking forward to the Python parser being GA, keep up the good work :)
[+] chillee|8 years ago|reply
Is it possible to install extensions (or perhaps support a couple of common ones)? For example, using vim keybindings is very important to my workflow.
[+] sdesol|8 years ago|reply
@sqs

Since you are posting in here, I figure I would ask. Are there plans to provide an API for Sourcegraph in the near future? My product is more focused on code history discovery and I was thinking it would be nice to be able to quickly transition into Sourcegraph for code browsing and search/analysis.

The discovery workflow would go something like this:

https://gitsense.com/media/source-graph-integration.mp4

For the API, it would nice to be able to just query Sourcegraph to see if the tree for that commit has been indexed and is searchable.

[+] sqs|8 years ago|reply
We do have an API available to customers running Sourcegraph internally. We plan to open it up to users of Sourcegraph.com in the future, but I don't have a date for that.

In the meantime, URLs like the following will stay around forever:

https://sourcegraph.com/REPO@GITREV/-/blob/DIR/FILE#L123

And there is no indexing step required (except for the initial clone), so you don't need to query for that. Sourcegraph's code analysis is realtime.

Feel free to email if you want more info! [email protected]

[+] zeusk|8 years ago|reply
This is definitely not a documented "API" but if you want to take the user to sourcegraph for a specific repo/file:line@commit then the url (currently) is:

sourcegraph.com/[repo]@[commit]/-/blob/[path/file]#L[line]

afaik repo must be on github.com (iirc bitbucket and GCP support was in the works) and commit can be either an absolute commit hash or a relative one like a branch name.

ie. https://sourcegraph.com/github.com/gorilla/mux@master/-/blob...

[+] dmitrygr|8 years ago|reply
Syntax highlighting is laughably bad

The "int" in "maintained" is highlighted in checkup_test.go as a type

[+] sqs|8 years ago|reply
Sourcegraph CEO here. There are indeed some glitches in syntax highlighting, on other languages as well. I hope it doesn't significantly detract from the product value, but I understand it is not good.

Here's why it's happening:

We're using TextMate syntax bundles, which require the Oniguruma regexp engine, which only has partial pure-JavaScript implementations that can run in the browser. We use https://github.com/bcoe/onigurumajs, which is great. We think something in this stack is producing different results than using C-based Oniguruma, and we'll work on it.

The good news is that we'll open-source whatever improvements we do make, so other folks building web-based syntax highlighting components will benefit.

[+] headmelted|8 years ago|reply
I have to say I'm really impressed by what you guys have achieved here.

I've been working for a while on different solutions to bring Visual Studio Code to more devices, among them Chromebooks (for which an in-browser editor would be ideal) - I'd be interested in seeing the writeup on this for sure.

What you have currently is quite similar to Azure's App Service Editor:

http://developingdane.com/content/images/2016/10/app_service...

It's a versatile system, so it's good to see it getting more attention in the open.

What's the story on things like extensions and a terminal? Have you plans to expand to there?

[+] mejamiewilson|8 years ago|reply
Sourcegraph Director of Product here: We're interested in extensions as a way for our users to extend our platform, you never know how creative developers are until they can hack your product! Do you have ideas in mind for extensions you'd like to build/use?

In relation to the terminal, do you have anything in mind you'd like to use it for?

[+] fortytw2|8 years ago|reply
main/out/vs sure looks like vscode artifacts, not just monaco set up all nice with a fileviewer/split panes

Super awesome to see vscode running outside electron

- http://imgur.com/L6ipQgb - https://github.com/Microsoft/monaco-editor

[+] sqs|8 years ago|reply
Sourcegraph CEO here. Indeed, this is based on the full version of VS Code, with heavy customizations and a new scalable language server backend for code intelligence. Huge thanks to the VSCode team for making an awesome editor core.

We will have a technical blog post with more details soon. :)

[+] just_testing|8 years ago|reply
Just dropping by to thank you guys. This extension will be amazingly useful to me.

One question for the good fellas at Sourcegraph: Is it possible to run that extension in firefox? Did you try something like that? Is the code open, so I could give it a go?

[+] lacampbell|8 years ago|reply
Can someone put this in some context for me? It's an IDE as a service, or what?
[+] atrudeau|8 years ago|reply
On a related note, is there any project targeting Vscode in a web browser? I would love to ditch tmux/Vim and move to remote vscode in browser. Currently I use vnc but perf is terrible.
[+] mr-kobayashi|8 years ago|reply
i don't mean any ill intent about this comment, however that said. i worked something similar, and i strongly feel the direction that SourceGraph is heading in is the correct one.

developing in the browser, especially at large organisations is a huge productivity benefit in addition to cost benefit etc. the pros are endless. just let your mind wonder.

intro -----

the one i worked on, alongside Sourcegraph is available at:

live: https://cloud.bana.io/monaco-go/ repo: https://github.com/mbana/monaco-go

the backend was adjusted somewhat to support a WebSocket connection, besides that, the code was almost written entirely by the folks over at Sourcegraph. please note i do not have funds to pay for the Azure cloud so it might be down, or seem very slow.

i would love to resume development on this seeing as i work at large organisation and i see the huge potentional.

implementation --------------

in my opinion, i think the approach taken in my implementation might be better. there was hardly any custom code aside from stubbing code out to make VScode, or rather, monaco-editor run in the browser.

i will stress, i can and want to continue finishing this and having it land in monaco-editor master but my current job doesn't allow it.

if anyone wants to join me, please do say.

[+] peterwaller|8 years ago|reply
I just see a black screen. Icon in top left, no text other than "Login" and "Sign up". Chrome 58, Linux. No errors in the dev console.
[+] sqs|8 years ago|reply
Sourcegraph CEO here. We're on it. We are seeing significantly increased load times for some users due to a bottleneck in our serving of Git data. Sorry about the issues...will be fixed asap.

Edit: Fixed. Thanks!

[+] fiatjaf|8 years ago|reply
If you're interested in Sourcegraph for reading code on GitHub you may be interested in this Chrome Extension I wrote that is in the same domain, although much less powerful: http://fiatjaf.alhur.es/module-linker/

(on the plus side my tool is very lean and fast and supports a ton of languages.)

[+] colemickens|8 years ago|reply
How... how is one meant to specify a repo?

If I type "colemickens" it lists my repos. But I have... a lot of them. "colemickens/repo-name" doesn't work. Nor does any other form I've tried.

edit: maybe it's a paging issue and the "repo-name" I was trying wasn't on the first page of my repos? Unclear...

[+] look_lookatme|8 years ago|reply
I converted to JetBrains products for a few different reasons, but one of the biggest was jump to definition that _just works_ across all language products. I suppose I could be made to consider something like this if it supported a number of other languages.
[+] Macha|8 years ago|reply
Your experience is greatly different to mine in webstorm. Better, sure, but I get about a 60% success rate. This was a vast improvement on basically anything else but it isn't _just works_.

Might be a pathological case however, the primary js project I work on is composed of about 12 modules, uses ES5 and Angular 1, except the build tooling which is ES6, has bower and npm dependencies, and has at times used every class/object pattern under the sun.

[+] ex3ndr|8 years ago|reply
Are you starting new language server instance for each project? Isn't it not-scalable?
[+] tinus_hn|8 years ago|reply
This looks very pretty and I am once again amazed by what can be done in the browser. I don't understand how this is going to make money though. What is the montization strategy?
[+] ippa|8 years ago|reply
Great work! Any plans to get keyboard-shortcuts (or something similar) working? I use them heavily in vscode.
[+] sqs|8 years ago|reply
Sourcegraph CEO here. There are a ton of keyboard shortcuts, and they (mostly) match VS Code's default ones. To see them all, hit Shift+Cmd+P (or Shift+Ctrl+P), and go to 'Preferences: Open Keyboard Shortcuts'.

Here are some of the key (no pun intended) ones:

Opt+S: Open QuickOpen (omni-search: searches files, workspace symbols, and repos) - Cmd-P and F1 also work

Opt+R: Go to repository

Opt+X: Run command (e.g., 'Open User Settings')

Opt+D: Go to symbol in workspace

Shift+Opt+D: Go to symbol in file

[+] Sean1708|8 years ago|reply
Am I being stupid here? There's no information on this website about what it is. I take it from sqs's that it's some kind of code viewer for Github projects, but I shouldn't need to come to HN to find that information out.

Edit: I was being stupid, the home page just didn't load the first couple of times I tried.