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.
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.
https://sourcegraph.com/github.com/eriknstr/VoxelMode-2.5D/-...
Everything on every line after '#' on line 21 is the same save for backslashes and ":3" which are blue.
This doesn't work either https://sourcegraph.com/github.com/rails/rails :(
Would be great if it worked, I liked the example with Go code.
As you can imagine, Ruby code intelligence (type inference, etc.) is super tough, and there are maybe 5-10 people in the world who could build it right now. We'd love to find and sponsor a Ruby expert to add Ruby support to Sourcegraph. If you know of anybody, please send them my way (sqs@sourcegraph.com).
Is it possible to use something to make this work?
https://gist.github.com/sqs/2a2680eff4dad159ae754756fe9326c2
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.
You can however set up your own keybindings by editing the keyboard shortcut settings. Open the Quick Open (on a Mac, Command+Shift+P or F1 on a PC), and type "Open Keyboard Shortcuts". From here you can configure any mappings you'd like.
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.
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! sqs@sourcegraph.com
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...
The "int" in "maintained" is highlighted in checkup_test.go as a type
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.
We use Atom's syntax highlighter for syntax highlighting on npmjs.com -- I originally wrote onigurumajs, because I was seeing if we could viably remove the website's only compiled dependency (oniguruma) ... I wrote it over vacation, and then had to put the work down.
I would love help to see the library over the finish line; on a grammar by grammar basis it would be great to figure out what the JavaScript regex engine is missing, and try to shim the logic.
why???
The great thing about using oniguruma, is that it lets you leverage the huge collection of grammars available for TextMate -- unfortunately JavaScript's regex engine doesn't support quite a few rules that are present in TextMate grammars.
VS Code offers pretty decent Monarch syntax definitions in the monaco-languages at [4]; you're probably better off just using those instead.
[1] https://microsoft.github.io/monaco-editor/index.html [2] https://microsoft.github.io/monaco-editor/monarch.html [3] https://github.com/Microsoft/monaco-editor [4] https://github.com/Microsoft/monaco-languages/tree/master/sr...
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?
In relation to the terminal, do you have anything in mind you'd like to use it for?
Super awesome to see vscode running outside electron
- http://imgur.com/L6ipQgb - https://github.com/Microsoft/monaco-editor
We will have a technical blog post with more details soon. :)
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?
I agree we should open-source the browser extension code, though. I would like us to do that soon. Can you send me a quick email at sqs@sourcegraph.com so I can tell you when it's open source?
(Also it says "Released under MIT/X11 License" already…)
If you find yourself reading code on GitHub a lot, or cloning repos to open and read in your editor, you'll find it useful. If not, then you probably won't find it useful, but you might like our Chrome extension, which adds these features inline on GitHub.com (https://chrome.google.com/webstore/detail/sourcegraph-for-gi...).
Out of curiosity, what was Sourcegraph running prior to this in-browser VS Code?
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.
Edit: Fixed. Thanks!
(on the plus side my tool is very lean and fast and supports a ton of languages.)
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...
If you don't see a repo that you know you have, then it might not yet be cloned on soucegraph.com because we clone repos lazily (try navigating directly to https://sourcegraph.com/github.com/colemickens/repo-name to trigger us to clone it).
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.
Try IntelliJ with plugins for Ruby, Python, PHP, NodeJS, Go, Rust - I agree that for the most part it just "works". Although you can "feel" it's Java engine sometimes.
[1] https://c9.io/
https://code.visualstudio.com/updates/v1_10#_preview-minimap
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
Edit: I was being stupid, the home page just didn't load the first couple of times I tried.