Using the VS Code plugin

In this article, you'll learn how to access all the features the VS Code plugin has to offer.

Prerequisites

The only prerequisites are that you have Kite Engine running and the VS Code plugin installed. If you don't have the VS Code plugin installed, you can learn how to do so here.

Note: If you installed the VS Code plugin while VS Code was already running, you'll need to restart VS Code for the plugin to activate

Checking the status of Kite

If Kite is installed properly, you should see a text indicator at the bottom left corner of the VS Code window.

There are a handful of possible states Kite can be in, as described in the following table:

Message

Description

Kite: Not Installed

Kite Engine is not installed.

Kite: Not running

Kite Engine is not running.

Kite: Not logged in

Kite Engine is running, but you need to log in.

Kite: Indexing

The Kite Engine is analyzing your code.

Kite: Ready

Kite is ready to go - start coding!

Note: If you're running Kite for the first time, it may take several minutes for Kite to finish syncing and indexing your codebase.

For the first three (red) states, the VS Code plugin will generally allow you take action to get out of the invalid state. For example, the plugin will allow you to start Kite Engine from VS Code directly.

Clicking on the indicator will open a tab that will allow you to access your settings or get information about your account.

Writing code and accessing features

Completions

To start, open a Python file in a whitelisted directory. Make sure that this file has been saved with a .py extension. Now type the following code:

import j # Cursor stops behind the "j"

A list of suggested completions should automatically appear.

Kite can provide autocompletions for Python keywords, name expressions or attribute expressions. The example above illustrates a name expression completion. An example of an attribute completion would be:

import json
json.d # Cursor stops behind the "d"

In the case of name and attribute completions, Kite will also provide the type of value represented by the completion (e.g. module or function) as well as documentation if available. To toggle the documentation for json.dumps, click on the “i” next to the function indicator.

Function signatures

Continuing with the example code above, complete the function call to by typing the opening and closing parentheses.

import json
json.dumps() # Cursor is in between "(" and ")"

Kite should show you information about how to call json.dumps.

As you type, Kite will show you which argument you are currently focused on.

Jump to definition

You can also jump to the definition of a module, class or function from your local codebase using Kite. The hover UI provides a deflink to do so.