click on it...

Story of my involvement with "Autocompletion Tools"

Before we even start!

2016 Literally was the most productive time of my life. I had 2900+ contributions this year:

While the past year was 985 contributions:

And that has made me focus all on these stuff that I’m making and don’t even talk about their existence. Hence for the sake of showing them I’ll be authoring a series of post to talk about the areas I’ve been worked and the projects that I made to show what has been going on in this year.

All about my past with autocompletes.

What an auto complete even is? Modern text editors extract all the words within a text file and when you’re writing the file they will suggest the words to you as to make the typing easier:

This is the most basic form of this tool. It has no clue what the word it’s suggesting to you even means. On languages that provide type notations (like C family, Swift, Rust, Go, for example TypeScript not JavaScript) the editor could even know what it was suggesting. So better autocomplete tools were made. Best of them the “IntelliSense” in the Visual Studio could provide a lot if you needed. They show you only what you can use, Only the available properties, They show you the kind and description of what you have in that context:

[Funny thing...](https://github.com/Microsoft/vscode/issues/13503)

I learned programming thanks to the IntelliSense, I love no developer tool more than intelliSense and autocomplete features that came after it. It’s a pretty impressive tool. I didn’t know about reading documentations, but I could go into the properties of a class, read their docs and learn the library as I navigated.

It’s funny but only chose languages and environments that I could have the richest autocomplete on them. I started with Visual Basic on Visual Studio, moved to C# on Xamarin Studio then shifted to Swift on Xcode and now I’m a big fan TypeScript on Visual Studio Code.

Gerda Engine

At design of my programming language Arendelle, One thing that I wanted to happen was to somehow have a type annotation while I had none. This way I could have a scripting like language while I could have all the awesome tooling you can get from a typed language. So I added the [ #, @, $, ! ] to the start of names. When we wanted to have our desktop IDE we wanted to have something just as rich as intelliSense. So I developed the Gerda Engine).

The first attempt was writing an engine that could read the code and by giving the caret position could give back the available spaces, sources, stored spaces and functions.

Gerda itself was a very cool project of mine. I thought instead of having a lexer/parser to determine the stuff I could make a very strange software to go through the code as an array of characters and match the stuff in only one iteration over the string. So the time of Gerda is actually O(n) which is a world record itself. You literally can’t make an autocomplete suggestion server faster than Gerda. It is scope-aware and also incrementally fixes the white spaces (As you know Arendelle names can have white spaces in them)

The result is available at Kary Foundation’s Archive for Experiment Playgrounds

After making the core I thought let’s actually make the editor view myself. It was a very excellent experiment and I had so much trouble finding the coordinates of the caret the screen but it actually turned out great. I also made a search algorithm to find sequential keys in the suggestions for the fastest typing:

The result is available at Kary Foundation’s Archive for Experiment Playgrounds

Gerda on Visual Studio Code

After Visual Studio Code got released, we got so much interested in it. A Text Editor that had intelliSense (configurable intelliSense!), Debugger, Task Runner and all the great editing features of the original Visual Studio. It was like all we wanted at one place. With that I thought one cool experiment could be to connect Gerda as the autocompletion provider for Arendelle and see what happens. Result was the coolest place to code Arendelle:

Black Screen

After my little experience with autocompletes, I found Black Screen. I knew of the project way before the whole story but this time I felt like I can add to the project. After fixing it’s theme I came across the fact that there was no good intelliSense. The search had a problem. It only matched the starting of the suggestion. This way you had to type the whole thing.

I started an issue and started working on that. Today I’m glad to say that with my search implementation as the last piece in the puzzle today Black Screen is the first Terminal Emulator that fully implements a rich intelliSense.

My journey with autocompletion has been a fun ride till now. At first it was something very useless and just experiments but I’m feeling that these experiments are starting to be beneficial. At least for Black Screen it was.

The team behind Black Screen seems to be busy with many stuff and even merging my changes my take too long. Soon I will start a fork of the Black Screen with my own theme and features and I will try to distribute it much faster. And I hope you enjoy the additions to it.

This was my first post in this series of what actually I’m doing and what may be interesting for you to use. I hope you’ve enjoyed it.

Top of Stack!