Git Product home page Git Product logo

copilot-clone's Introduction

Captain Stack

Captain Stack — Code suggestion for VSCode

This feature is somewhat similar to Github Copilot's code suggestion. But instead of using AI, it sends your search query to Google, then retrieves StackOverflow answers and autocompletes them for you.

Captain Stack is launched on Product Hunt and would appricate your support

Captain Stack - An open source alternative to GitHub Copilot | Product Hunt

Demo Video

Table of contents:

  1. Installation
  2. Play with Captain Stack
  3. Notes
  4. Changelog

Note: ⚠️ This extension uses a proposed API (inline-completion) and can only be used for extension development in VSCode Insider release. It's not yet available on VSCode


1. Installation

Before installation, make sure you have VSCode Insider. You'll be using this version

To install and starting Captain Stack:

  1. Download this repository to your local machine
  2. Run npm install in the terminal to install dependencies. A postinstall script would download the latest version of vscode.proposed.d.ts
  3. Run the Run Extension target in the Debug View. Or from the top menu, choose Run > Start Debugging.

This will:

  • Start a task npm: watch to compile the code and watch for changes
  • Open a new VSCode windows (you should play the extension here)

Note: when you make changes, you should refresh that windows to apply changes. To refersh, open Command Palette (Command+Shift+P on MacOS, or Ctrl+Shift+P on Windows), then choose "Developer: Reload window"


2. Play with Captain Stack

To trigger inline completion, you'll need to type //find {your keyword}. (start with //find, end with a dot .)

For example

//find binary search in javascript.

Make sure that showInlineCompletions is enabled in your settings!

"editor.inlineSuggest.enabled": true

3. Notes

  • The extension use fetch-node to get page content, and I don't know if there is any fetching limit
  • The extension uses querySelector to extract code and other info. There is a risk when either StackOverflow or Google changing its querySelector
  • There are more code sources that should be considered besides StackOverflow

If those factor became problems, the extension could be using their official APIs instead.

4. Changelog

  • Jul 01, 2021 - Added snippet source (thanks for mechero's suggestion)
  • Jun 30, 2021 — Publish the initial version

Feel free to open a thread for feedback or discussion. And have fun!

copilot-clone's People

Contributors

hieunc229 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.