4 ms·
My beef with GitHub's code search is that it doesn't distinguish between the definition of a symbol and the uses of the symbol, so you need to wade through 5 p
by PaulHoule 4y ago
My beef with GitHub's code search is that it doesn't distinguish between the definition of a symbol and the uses of the symbol, so you need to wade through 5 pages of results to get the one result you're looking for. I would contrast that to my IDE which usually scores a direct hit if I enter a search in the right box.
The indexing they talk about in that article seems like rearranging the deck chairs on the Titanic so far as that is concerned.
- DontchaKnowit 4y agoThank you. This is SUCH an obvious feature that seems super trivial to implement.
- xavdid 4y agoI'm not sure how to read the post and come away thinking any of this is "super trivial", but I'd imagine if it were that easy, they would have done it already.
- Zuiii 4y agoIt's simple enough that most IDEs implement it. Take from that what you will.
- rlt 4y agoThe fact that most IDEs implement it doesn’t mean it’s trivial. I believe most IDEs leverage “language servers” written ~once per language and used by many IDEs. It’s possible GitHub could also leverage those language servers (which would be super cool) but doing it at GitHub scale is certainly not trivial. Poor man’s version using the new GitHub search would be to construct a regex that matches one but not the other.
- bobbylarrybobby 4y agoI think running a language server over a repo would be a reasonable addition to the current index. Should also be pretty small compared to the current index because the number of n grams far exceeds the number of symbols/items.
- kgeist 4y agoGitHub hosts 28 million public repositories. Do you think your IDE can open 28 million projects at once and search there "trivially" without hanging? Unless you're talking about searching inside a single repository?
- PaulHoule 4y agoI am talking about searching in a single repository, who would expect to get useful results otherwise? I have no idea how you’re going to rank 28 million repos in a way that matches my perception of relevance. To be specific, I was looking for the definition of one method in Highcharts so I could understand what it does and override it, GitHub gave 6 pages of results. I was able to find the function immediately in my IDE once I checked out the 100mb+ repository and it indexed it. If I’d been able to the same w/ the search on GitHub it would have saved me considerable time and hassle. This search could be implemented by something that compiles and indexes like the IDE (sourcegraph) or maybe some kind of shallower parsing. Highcharts is in typescript which I’d don’t know well but in JavaScript the later might be a little tricky because there are so many ways to define a function (one hell of a regency.). I’d contrast to Java where is would be very easy to write a rule that would turn up a class definition if not a method definition, in my case finding the class would have solved my problem.
- keegancsmith 4y agoSourcegraph engineer here. I'd be interested to know what you were searching for and what your expectation for top result was. We already do things like boost class name matches higher than functions (GitHub's new search does the same) amongst other possible signals.
- PaulHoule 4y agoI am searching this repository https://github.com/highcharts/highcharts https://github.com/highcharts/highcharts for Series.drawPoint and expecting a direct hit for https://github.com/highcharts/highcharts/blob/29d2a83a5a997bd53aeb14893bdb5548333f6109/ts/Core/Series/Series.ts#L2624 https://github.com/highcharts/highcharts/blob/29d2a83a5a997b... practically I tried "Series" and "drawPoint" also.
- jesuspiece 4y agoseems like such a basic feature too
- semiquaver 4y agoThe new code search supports regular expressions so this is pretty easy to do yourself. If you’re looking for where a go method is defined: /func.+MyFunc/ vs a search for where it is used: /\.MyFunc/ I agree that it would be nice to have more language aware IDE-style features but I’m just happy to have regex support which is almost always powerful enough to express what I am looking for.
- denysvitali 4y agoCheck out sourcegraph.com