News for hackers. Stuff that matters.
Re:Github1s – One second to read GitHub code with VS Code by lxe on Tuesday February 09, 2021 @09:36PM (#26085168)
There are software projects that get posted once in a while on HN that are on a completely different level of quality, whether it's product, UX, or tech. This is one of those posts.
Re:Github1s – One second to read GitHub code with VS Code by stanislavb on Tuesday February 09, 2021 @10:01PM (#26085309)
This one is amazing. I've cloned so many repos locally with the only reason to explore them with the comfort of VS Code.
Re:Github1s – One second to read GitHub code with VS Code by news_hacker on Tuesday February 09, 2021 @11:39PM (#26085796)
I really wish it had Cmd+P support for searching for project files.

I find the project a really cool concept, but am genuinely curious what real value this is adding in it's current incarnation? Navigating the folder structure is kinda nice, but I don't see much else.

Am I missing something obvious?

Re:Github1s – One second to read GitHub code with VS Code by perryizgr8 on Wednesday February 10, 2021 @01:23AM (#26086197)
> what real value this is adding in it's current incarnation?

Ctrl+Shift+F works. I've forgotten how many repos I clone off github just to be able to search all through the code.

Re:Github1s – One second to read GitHub code with VS Code by rkangel on Wednesday February 10, 2021 @06:23AM (#26087861)
> Ctrl+Shift+F works

It's not working for me (it's also the first thing I wanted). It only seems to search through files that are already open in an editor tab. E.g. in the vscode repo linked from the README search for "nodeModulesPath" and no results, but open bootstrap-node.js and it's there on line 22.

Re:Github1s – One second to read GitHub code with VS Code by xmprt on Wednesday February 10, 2021 @01:25AM (#26086200)
Github allows you to search through repositories as long as they're not forks.
Re:Github1s – One second to read GitHub code with VS Code by KerrickStaley on Wednesday February 10, 2021 @01:55AM (#26086316)
GitHub search is notoriously poor, though—it can only match whole words (e.g. the query "FooBar" does not match the text "FooBarBaz"), and it doesn't support regexes.
Re:Github1s – One second to read GitHub code with VS Code by loganlinn on Wednesday February 10, 2021 @04:58AM (#26087339)
If anyone is looking for actually useful cross-repo search: https://grep.app/
Re:Github1s – One second to read GitHub code with VS Code by Ayesh on Wednesday February 10, 2021 @08:44AM (#26088884)
This is great, thank you.
Re:Github1s – One second to read GitHub code with VS Code by dathinab on Wednesday February 10, 2021 @04:56AM (#26087327)
And way worse it doesn't even keep word order and similar.

So searching for `fn foobar` will return any file containing the words `fn` and `foobar` not caring about you looking for `fn foobar`.

Then if you find what you want opening the preview doesn't jump to the right line in the file so I have to search again using "find in page".

Re:Github1s – One second to read GitHub code with VS Code by nightpool on Wednesday February 10, 2021 @03:02AM (#26086645)
In addition to the flaws mentioned by the other commenters (whole word only, no regexes), Github will only search the master branch of a repo, which makes it useless for my two most common tasks "where did this code used to be used" and "does this unmerged PR manage to remove all of the references to this code in its refactor (incl. in comments/etc)"

EDIT: Unfortunately, it seems like search doesn't work at all on this site, which is a shame. (at least, when I tried to do it on https://github1s.com/rails/rails it failed)

Re:Github1s – One second to read GitHub code with VS Code by soenkeliebau on Wednesday February 10, 2021 @06:12AM (#26087772)
It does have search, but I'd be willing to wager that the normal workflow when using that is "try searching for something, look at the results page, swear, clone, ..."
Re:Github1s – One second to read GitHub code with VS Code by perryizgr8 on Wednesday February 10, 2021 @01:29AM (#26086213)
How does that work? I've never been able to find this option. Also, this tool's search is broken. It searches only the currently open file.
Re:Github1s – One second to read GitHub code with VS Code by imron on Wednesday February 10, 2021 @04:17AM (#26087073)
And as long as you’re not trying to do a case-sensitive search.
Re:Github1s – One second to read GitHub code with VS Code by arebhaibhai on Wednesday February 10, 2021 @03:57AM (#26086942)
> I really wish it had Cmd+P support for searching for project files.

Works for me. CTRL+P on Linux though.

Re:Github1s – One second to read GitHub code with VS Code by visarga on Wednesday February 10, 2021 @03:42AM (#26086852)
> Am I missing something obvious?

Better search, find definition, ...

Re:Github1s – One second to read GitHub code with VS Code by chrisshroba on Wednesday February 10, 2021 @09:48AM (#26089806)
Search is completely broken for me... for example on https://github1s.com/matryer/bitbar, searching for just the letter "a" returns no results. Am I doing something wrong?
Re:Github1s – One second to read GitHub code with VS Code by Kwantuum on Wednesday February 10, 2021 @09:55AM (#26089923)
Search appears to only work once the files are cached, if you open a file then close it, search will find it.
Re:Github1s – One second to read GitHub code with VS Code by Brian_K_White on Wednesday February 10, 2021 @10:55AM (#26090849)
Then you need to cache all files, which you were already doing years ago by cloning and browsing locally.

I too see no special value in the end.

Re:Github1s – One second to read GitHub code with VS Code by chrisshroba on Wednesday February 10, 2021 @10:06AM (#26090097)
Ah, makes sense! Thanks!
Re:Github1s – One second to read GitHub code with VS Code by ollysb on Wednesday February 10, 2021 @07:54AM (#26088456)
It appears to only work for files which have already been opened.
Re:Github1s – One second to read GitHub code with VS Code by KiranRao0 on Wednesday February 10, 2021 @01:13AM (#26086150)
Nothing obvious. I've found Cmd+Shift+P, then delete the > character, works extremely well in place of Cmd+P.
Re:Github1s – One second to read GitHub code with VS Code by flanbiscuit on Wednesday February 10, 2021 @01:07PM (#26092683)
Confirmed CMD+P just worked for me on mac.

Shift+CMD+P does not but without Shift it works

Re:Github1s – One second to read GitHub code with VS Code by dingran on Wednesday February 10, 2021 @06:36AM (#26087942)
Yeah, I do the same. I feel the thing that's missing is navigate to definitions/declarations (cmd+])
Re:Github1s – One second to read GitHub code with VS Code by beermonster on Wednesday February 10, 2021 @12:07PM (#26091850)
Yup. T'is pretty good indeed. I have told world+dog.
Re:Github1s – One second to read GitHub code with VS Code by soenkeliebau on Wednesday February 10, 2021 @06:11AM (#26087761)
This, so much this!
Re:Github1s – One second to read GitHub code with VS Code by crazypython on Wednesday February 10, 2021 @01:57PM (#26093260)
We are so used to JavaScript SPAs taking a long time to load. People will Webpack it then use a tool to inline CSS and sort scripts. I find it easier and faster to use no loader at all, and manually sort scripts. The build process is less likely to break, because there is none, and it builds instantly, because there is none, it loads directly from the filesystem. Most modern browsers (even with IE11 included) support enough ES6 features that you can write your code directly in the common supported subset.[0] I had a multiplayer game with hundreds of hours of gameplay get on the front page with "loads in less than one second" in the HN headline. (http://vnav.io)

[0]: https://wwwperiodictable.surge.sh

Re:Github1s – One second to read GitHub code with VS Code by fancyfish on Wednesday February 10, 2021 @02:07AM (#26086372)
This. This just nails it. I honestly was in awe when I saw this repo, you don’t see these very often on here. So much Tier 1 talent in all aspects - product, UX, and tech.

Flawless execution on all fronts. I’ve always wanted an easy way to preview a repo in VS Code and this is it.

Re:Github1s – One second to read GitHub code with VS Code by sudeepj on Tuesday February 09, 2021 @10:59PM (#26085599)
Agreed. This also demonstrates: Does one-thing and does it well.
Re:Github1s – One second to read GitHub code with VS Code by alpb on Wednesday February 10, 2021 @12:04AM (#26085900)
It surely opens a repo in VSCode, but it doesn't seem to have any language server support built in. For example, if I open a Go repository, I can't navigate code (Go to references, Find references etc). GitHub Workspaces (although takes waaay longer to provision) is better at this. I wish GitHub did a faster loading read-only version like this.
Re:Github1s – One second to read GitHub code with VS Code by hoten on Wednesday February 10, 2021 @01:23AM (#26086195)
I'm only speculating, but the reason is likely because language servers are not written in JS. I assume electron apps can spin up arbitrary processes, allowing for a language servers to be written in anything. It'd be neat to see these language servers compiled to WASM and run as a web worker, although I suspect vscode isn't setup for that.

I think Codespaces is able to pull it off because the language servers, and vscode itself, is really running on Github's backends. They've set up the frontend to connect to a remote host.

Re:Github1s – One second to read GitHub code with VS Code by arcticbull on Wednesday February 10, 2021 @01:25AM (#26086202)
I handle this by firing up a Fargate instance with a Docker container pre-configured for VSCode Remote SSH. Then once you connect to it, you can install whatever language server you want assuming it's not baked into the Docker image. An EFS mount persists my sources across runs too, and I can scale it up to whatever size Fargate instance my development of the day needs.

Would be cool to tie it into this.

Re:Github1s – One second to read GitHub code with VS Code by vijaybritto on Wednesday February 10, 2021 @01:57AM (#26086325)
Thats the trade off. If you have everything supported upfront then the loading performance would be abysmal and it would take 2 minutes to load the entire app on a desktop machine. This is perfect for browsing through code.
Re:Github1s – One second to read GitHub code with VS Code by heyoo on Wednesday February 10, 2021 @03:05AM (#26086661)
So surely, it will never make money. :(
Re:Github1s – One second to read GitHub code with VS Code by forgotmypw17 on Wednesday February 10, 2021 @03:26AM (#26086748)
why is that a sad face? do things have to earn money to have any worth?
Re:Github1s – One second to read GitHub code with VS Code by stjo on Wednesday February 10, 2021 @04:21AM (#26087093)
It would be nice reward the author for making something that is useful, not just by patting him/her on the back. I think that is what heyoo is talking about
Re:Github1s – One second to read GitHub code with VS Code by krelian on Wednesday February 10, 2021 @06:02AM (#26087704)
Creating a useful tool that becomes well known (or a de facto standard) in the community, a successful project you proudly add to your resume, can pay for itself and much more indirectly.
Re:Github1s – One second to read GitHub code with VS Code by systemvoltage on Thursday February 11, 2021 @11:31AM (#26103537)
Not as lucrative as profiting directly from it.

I respect non open source software very much. They put hard work into it, and I have absolutely zero, zilch right to ask for its source. I am willing and happy to pay for a service if it benefits me. OSS and non-OSS can coexist. There is no need to bash on non-OSS software. It's folks like you and me, writing code, providing for the family.

Github1s, I could see myself paying $50 for a yearly fee. I would use this thing all the time.

Re:Github1s – One second to read GitHub code with VS Code by pestaa on Wednesday February 10, 2021 @04:37AM (#26087192)
I get the opposite vibe from the parent comment: that usefulness and worthiness is often detached from monetary reward.

How nice it would be for great work to be compensated more fairly.

Re:Github1s – One second to read GitHub code with VS Code by worldsayshi on Wednesday February 10, 2021 @05:29AM (#26087527)
If it doesn't make money but need to run infrastructure it's not likely to live for very long?
Re:Github1s – One second to read GitHub code with VS Code by blocked_again on Wednesday February 10, 2021 @05:13AM (#26087419)
def do_things_have_to_earn_money_to_have_any_worth(dev: Developer) -> bool:

    if dev.strong_financial_background():

      return False

    return True
Re:Github1s – One second to read GitHub code with VS Code by blocked_again on Wednesday February 10, 2021 @05:09AM (#26087398)
It can make a shit ton of money through programming job ads.
Re:Github1s – One second to read GitHub code with VS Code by yarcob on Wednesday February 10, 2021 @05:31AM (#26087536)
Good point. I think most people aren't aware that it costs €500 - €1000 to post a single job ad on an important platform.

Of course, the rate will be a lot lower for small companies, but with something like this you'd have perfect targeting. And you don't even need any invasive privacy tracking for targeting: Just let people buy ads on specific repos.

Also, at least in my personal experience, people really don't mind job ads. Job ads are the only ads I regularly click on, because I'm curious what companies are looking for (even though I'm not looking for a job)