News for hackers. Stuff that matters.
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