ScriptSense

ScriptSense is a Visual Studio Code extension that uses AI for code completion.

Inspiration

Our team was inspired to create this project when we heard of Open AI’s still relatively new GPT-2 unsupervised language model. It has been used by people for fun to predict/generate paragraphs, so we decided to take that and apply it to something useful — code completion! Currently, current popular code completion solutions like IntelliSense are pretty good, but the problem is that they can usually only suggest the next word in the code. ScriptSense attempts to predict/generate the next few lines of code using Open AI’s GPT-2 unsupervised language model.

What it does

ScriptSense completes the next few line(s) of your code. All you have to do is write some code or write a comment, then press “ctrl+space, enter” on Windows or “cmd+space, enter” on macOS. It works for most simple code, but will not work at all in code using external libraries, algorithms, classes, recursion, or any other more complex concepts. Given sufficient time and data for the model to train, ScriptSense should work for theoretically all programming languages.

How we built it

We first used TypeScript to get the text on the line that you typed in Visual Studio Code. Then we used Python to request the output data based on the input data from the server which was running the OpenAI GPT-2 1.5B unsupervised language model. Then we fed that data through a data pipe to the TypeScript & Javascript files in the Visual Studio Code extension, which we then would display as a suggestion in Visual Studio Code.

Challenges we ran into

We had some issues with conflicts with other Visual Studio Code extensions, as well as problems with random critical warnings and errors. Often, the extension would take too long to start up, and sometimes no code completion suggestions would popup. Eventually, we managed to fix all these issues. In the end we still had a few issues, but it was good enough for a demo. One of our largest challenges was that one of our team members' wifi wasn't working. After messing around with the internal wiring of the house for a few hours, he finally managed to fix the issue — but by that time there was only one hour left in the hackathon, and there were still a few things that needed to be completed.

Accomplishments that we're proud of

We are proud that we got the OpenAI GPT-2 1.5B model working and the Visual Studio Code extension code completion suggestion working.

What we learned

Our team learned how to use OpenAI’s GPT-2 model as well as how to create a Visual Studio Code extension and feed data through data pipes between different programming languages.

What's next for ScriptSense

Our team would like to further improve everything in the extension overall, finish the project, and fix the remaining issues. Finally, we are interested in polishing the project and publishing ScriptSense as a Visual Studio Code extension on the public extension store.

Built With

+ 3 more
Share this project:

Updates