r/node • u/grubstreet1 • Aug 18 '21
A VS Code extension that finds common open-source code patterns
18
u/taschana Aug 18 '21
Looks cool! But the copy paste could probably be made a bit more comfortable, like a button on the lines' beginning saying "copy line into my file at cursor position". Pure perfection.
15
u/grubstreet1 Aug 18 '21
Completely agree, and working on it for an upcoming release!
5
u/taschana Aug 18 '21
That sounds great :)
I will have a look at it once I can continue working on my project.
5
4
4
u/akshay-nair Aug 18 '21
I like this better than co-pilot. Great job! Any hope for vim/nvim plugin for this?
3
43
u/JND__ Aug 18 '21
Sounds like a Copilot with extra steps. /s
42
u/catNamedStupidity Aug 18 '21
Honestly this looks like copilot with better attribution
5
20
2
u/Rudecles Aug 18 '21
Ooh-la-la. Someone’s going to get laid in college.
3
3
1
u/turtle_mekb Aug 18 '21
is this for atom?
4
u/grubstreet1 Aug 18 '21
Just for VS Code at the moment - will look into an atom implementation though in future
3
1
1
u/334578theo Aug 19 '21
Where do the code snippets come from? Public Github repos? If so, how do you decide what is a good snippet and what is a bad snippet?
Not trying to pick holes, just there is a lot of very average code out there.
1
u/wekatoa Aug 19 '21
look great. I am waiting for supporting other languages such as Python, Java...
0
Aug 18 '21
[deleted]
12
u/grubstreet1 Aug 18 '21
I post when I’ve made major new updates. A few weeks ago I wrote in r/node that I was working on retrieving open-source code examples, so just wanted to let the community know that they're now ready to use!
32
u/grubstreet1 Aug 18 '21
Get it here! Works for JS and TS!
When I'm getting familiar with a new library I often look through open-source code to see how other developers use its functions. For example, when I was learning axios I looked through Github repos to see how people handled HTTP request errors.
But using a combination of Github and Google to search for code is inefficient and frustrating, so I built an extension that extracts common usage patterns from open-source code and displays them in a sidebar - so as you use functions you can see how other developers have used them too. Hover over the blocks of highlighted code and see just how common the pattern is.
The extension also:
- Displays code examples scraped from library documentation
- Has a search engine that lets you search for npm module functions in plain english
Let me know what you think! Thanks!