Skip to content

Big O is a VS Code extension which allows you to use GPT models within VS Code to increase code efficiency (speed, memory), make code more readable and solve problems

Notifications You must be signed in to change notification settings

miranamer/BigO-vsCodeExtension

Repository files navigation

Big O - VS Code Extension [BETA] v2.3.0 -> Add API Key First

Trailer

Big.O.Trailer.-.Made.with.Clipchamp.mp4

What This Does?

This VS Code extension allows you to determine the time complexity of a your code (using Big O() notation) and also produces a more optimised version of your code. It does this by sending the code you highlight over to GPT-3, an AI model made by OpenAI. This then sends back the time complexity of the function which is shown in the bottom right of the IDE. If you choose to optimise it, GPT-3 will send back a more time efficient version of your code in a new editor on the right.

Features:

  • Get Time Complexity
  • Make Code More Efficient - With Respect To Time Complexity
  • Debug Code - Removes Errors
  • Make Code More Readable By Adding Comments
  • Convert Code To Another Language
  • Solves Programming Problems By Returning Coded Solution

How To Use The Features:

How To Get Time Complexity

  1. Reload VS Code After Downloading (may be slow at first as server is starting up)
  2. Highlight The Code You Want To Evaluate
  3. Click Ctrl+Shift+P Whilst Code Is Highlighted
  4. type 'Get BigO() - Time Complexity'
  5. Select It
  6. Wait For Result, It Will Appear On Bottom Right

How To Get More Efficient Code (v2.0.0)

  1. Highlight The Code You Want To Optimise
  2. Click Ctrl+Shift+P Whilst Code Is Highlighted
  3. Type 'Optimise Code Efficiency'
  4. Select It
  5. Wait For Result, New Editor Will Appear With Faster Code On The Right

NEW: How To Debug Code (v2.1.0)

  1. Highlight The Code You Want To Debug
  2. Click Ctrl+Shift+P Whilst Code Is Highlighted
  3. Type 'Debug Code'
  4. Select It
  5. Wait For Result, New Editor Will Appear With Debugged Code On The Right

NEW: How To Make Code Readable (v2.1.0)

  1. Highlight The Code You Want To Make Readable
  2. Click Ctrl+Shift+P Whilst Code Is Highlighted
  3. Type 'Make Code Readable'
  4. Select It
  5. Wait For Result, New Editor Will Appear With Readable Code On The Right

NEW: How To Convert Code To Another Language (v2.1.0)

  1. IMPORTANT: Add A Comment Above Code Snippet With New Language To Convert To
  2. Highlight The Code, Including The Comment
  3. Click Ctrl+Shift+P Whilst Code Is Highlighted
  4. Type 'Convert Code To Another Language'
  5. Select It
  6. Wait For Result, New Editor Will Appear With Converted Code On The Right

NEW: How To Solve Programming Problem (v2.1.0)

  1. Paste In The Problem Statement Along With Any Example Test Cases
  2. Highlight The Statement, Including The Test Cases
  3. Click Ctrl+Shift+P Whilst Statement Is Highlighted
  4. Type 'Solve Programming Problem'
  5. Select It
  6. Wait For Result, New Editor Will Appear With Coded Solution On The Right

Tip

If Your Algorithm Takes In A Data Structure As A Parameter, Also Select The Data Structure In The Highlighted Text, Otherwise GPT-3 Wont Know The Length Of The DS.

Example: Don't Do This

image

DO THIS:

image

Demo Vid

BigO_public_vid.mp4

Running On Different Algorithms

BigO_vid_new.mp4

Using Algorithm Names:

BigO_text_vid.mp4

Using Optimise Code Feature

BigO_optimise_vid.mp4

in this case, the time complexity decreased from O(n^2) -> O(n), hence making the solution faster

Debug Code Demo

debugCode_vid.mp4

Readable Code Demo

readableCode_vid.mp4

Convert Code Demo

convertCode_vid.mp4

Solve Programming Problem Demo

solveCode_vid.mp4

Future Ideas

  • Add A Loading Indicator Whilst Result Is Being Fetched
  • Provide An Option To Increase Function Speed ( e.g: O(n^2) -> O(n) )
  • Store Highlighted Functions

About

Big O is a VS Code extension which allows you to use GPT models within VS Code to increase code efficiency (speed, memory), make code more readable and solve problems

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published