All Projects → curtischong → complete

curtischong / complete

Licence: other
The VSCode extension that accelerates dev time by 1,000,000,000%

Programming Languages

typescript
32286 projects

Complete

Complete is a VSCode extension that introduces other people's ideas into your code. Written by Curtis Chong, Akshay Saxena, Mayank Kanoria, and Vikram Subramanian.

A gif of the function generation code A gif of the search code

Features:

  • Automatic Code Generation from pseudocode (Only Python).
  • Search for similar functions found on public repos (Only Python).

Why Should You Use This?

  • You can generate entire programs just by writing pseudocode - competitive programmers watch out!
  • You can search for similar functions by other developers - Improve your implimentation by copying code from others!

Installation:

  • Make sure you have complete-server running.
  • Open this reposity within VSCode then hit F5. This will launch another VSCode window that will has the extension loaded within it.
  • Now open the VSCode command palette ( by hitting cmd + shift + p at the same time).
  • Next type in the command Code Search. This will open up a new panel with the Complete search bar on it.
    • Feel free to put VSCode in splitscreen and place the side panel to the side!

Pseudocode -> Function Usage

  • Go into a file you're working in and type a description of what you want your function to do. The longer it is the better.
    • Ex: Calculate the L2 Norm of 2 vectors,
  • Now surround your Pseudocode with @S (start) and @E (end).
    • Ex: @SCalculate the L2 Norm of 2 vectors@E (spaces don't really matter).
  • The Complete extension will now send your pseudocode to a Neural Net trained by Github and will await a response.
  • Feel free to chain multiple pieces of Pseudocode together like you're scoping out the steps of your program. You don't need to wait until each function is generated before starting to write another. The requests are queued :)
  • Note: If the function generated is undefined, then no suitable function was close enough to match your description.

Similar Function Search Usage

  • Type into the search box a piece of code you're interested in looking in. Library functions are typically the most useful.
  • Highlight a section of code. We will search for other sections of code that are similar to your code.

How Does the Pseudocode Generator Work?

  • None of us are qualified to explain this. However, Github, the ones that trained the model, is: github.blog/2018-09-18-towards-natural-lan: guage-semantic-code-search.
  • From a high level, the model represents your pseudocode description as vector. You can read more about how a vector represents a word here. It then takes the vector representation of your pseduocode and will search for a function description that has a similar vector representation. This function description is mapped to the function it describes. So all it needs to do is to find the most similar function description vector that looks like your pseudocode vector, then return the corresponding function of the function description.

How Does the Function Search Work?

  • We found an API (searchcode.com) that allows you to search for code within public repos on Github, Bitbucket, Google Code, SourceForge, Fedora Project, and Gitlab.
  • For every function you highlight, we first parse away syntactic nuances and pick out key terms, particularly function names (from packages) and other variables. Then we construct a list of terms to send to the API. This includes the names of the functions from the packages and a TF-IDF weighted score of your variable names.
  • After we get the search, we highlight the package names returned and send it off to the client!
Why Is the Code So Bad?
  • We built this over Hack the North 2019... ¯\(ツ)
When Can I Download It on the VSCode Extensions Store?
  • I (Curtis) will fix it up and release it as a proper extension on the store if school takes a step back and cuts me some slack :)
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].