15 comments

[ 5.9 ms ] story [ 53.7 ms ] thread
Copilot is trending and I thought I'd make something for fun.

Captain Stack is a VSCode extension that mimics Copilot's code suggestion feature. But instead of using AI, it filter search results on Google and return a list of code suggestion option

It was meant for fun. Though I realized this method is quite effective since that's just what devs usually do

Feedback and question are welcome

Nice work! I would assume something like this would quickly run into rate limiting on google, does that happen or did you do something to mitigate?
I'm not entirely sure, I had a look but didn't find anywhere mentioned about it.

The extension run in nodejs environment, and use fetch-node to get page content. I assume it's similar to how someone use google on broswer

There is always the option of downloading a data dump from https://archive.org/details/stackexchange indexing it and querying it.

You can even make your tool offline and private :)

Add a few transformers on top, and you can have it generate dubious code.

Though if you want to be competitive you'll probably need a few phd and M$ of computing resources or use some free tpu like https://colab.research.google.com/ and hope to not get rate limited :)

(comment deleted)
Good suggestions.

Another one to consider is Google and Stackoverflow offical API

In past jobs I used the Internet and MSDN and Google to research problems and debug them. Management didn't like me using the Internet even if it was job related and it would take longer to debug without looking stuff up.

Captain Stack would search Google for me, racking up Internet time, which I would get in trouble for.

It is a tool not a toy, I use the Internet instead of reading books because books are outdated as soon as they are published.

A dev job where you can’t use the internet :-0
That's harsh.

If you think you could use it and have suggestion, let's open a thread on Github and discuss

It was a law firm that knew nothing about design, research, debugging, etc.

I might be able to use it if it pulls legit code, and not joke code.

The results are actual answers from StackOverflow.

The problem it has now is sometimes, answers can be the actual code. Or sometime, the answers is about explaining something (the code on those answers are not whole).

Besides, VSCode isn't officially support inline-completion yet. So this extension can only run on VSCode Insider for now

That said, the code is no joke

You say “parody” I say “this could be actually useful!”
Hey this is great! It even checks if answers have the checkmark so it's not just a random code block.

I think it would be even better if you insert also a comment line with the link to StackOverflow, so devs can check it to get the full context.