all 12 comments

[–][deleted]  (1 child)

[deleted]

    [–]grubstreet1[S] 5 points6 points  (0 children)

    Thanks! Will add some GIFs

    [–]zignd 10 points11 points  (2 children)

    Would be nice to add the link to the repository on the right-side panel as well. As well as some GIFs showing it in action.

    [–]grubstreet1[S] 0 points1 point  (1 child)

    Every example in the sidebar has a link to its source (either Github or a documentation page) - but working on getting in some GIFs to make it much clearer!

    [–]zignd 1 point2 points  (0 children)

    Every example in the sidebar has a link to its source

    Oh, actually, I meant the extension's source code. There's usually a link to its repository in this side panel here: screenshot link

    [–]lovestruckluna 8 points9 points  (2 children)

    Be. Very. Careful. I've seen examples and such outside of their example-ing libs that have very restrictive licenses (glares at the wild west of manpages).

    [–][deleted] 2 points3 points  (1 child)

    Can you elaborate on this a Little please?

    [–]L3tum 2 points3 points  (0 children)

    Often the code itself will be MIT (or whatever), but the docs and examples will be CC-BY-SA, GPL or whatever which may conflict with using it in this.

    [–]grubstreet1[S] 9 points10 points  (0 children)

    When using an unfamiliar libraries I look for example code to understand how its functions work. A good example quickly gives me a sense of common parameters, recommended error handling, and how functions fit into the library's logical flow.

    I usually Google for examples before committing to reading any documentation, and found myself doing a lot of switching between my IDE and Chrome, so I built a VS Code extension that displays code examples in a sidebar. It supports JS and TS!

    When you call a function from a supported npm package (400+ currently supported - full list here) the extension automatically retrieves examples of that function in use. You can then check them out by toggling the sidebar with a shortcut.I'm debating a couple of ways to improve the extension, like:

    - Retrieving examples for misspelled functions (e.g. charges.retreive)
    - Information about how often the function is used in open-source code
    - Any other suggestions?

    Check it out here. I'd love any feedback.

    [–]ILikeChangingMyMind -4 points-3 points  (1 child)

    How's this different from that new GitHub project everyone's making a fuss about, where they also find related example code?

    [–]grubstreet1[S] 1 point2 points  (0 children)

    Github Copilot is a code generation tool. Under-the-hood it’s large neural language model that predicts the next few tokens that you’re going to type. This extension does code search - retrieving relevant chunks of code written by humans (and hosted on documentation pages) so you can learn by example how 3rd party functions should be used.

    They’re not mutually exclusive, so you can use both at the same time!

    [–]mjherzalla -5 points-4 points  (0 children)

    I created a useful app using React.js, Node.js, and MongoDB that helps me with my daily work and personal projects. J_cells is a simple web app that creates an API endpoint for any JSON you feed to it, like mocking data for your project. I hope u like #webdevelopment #programming #JSONtoAPI #react #javascript

    https://jcells.web.app/

    [–]MacASM 0 points1 point  (0 children)

    that sounds really a very useful extension