Merge branch 'master' into tweak-code-nav-decoration

This commit is contained in:
Daniel Hung 2021-01-27 17:11:04 -08:00
commit dd1aaa0407
6 changed files with 133 additions and 50 deletions

View File

@ -1,10 +1,27 @@
# Kite Autocomplete Plugin for Visual Studio Code
Kite is an AI-powered programming assistant that helps you write Python & JavaScript code inside Visual Studio Code. Kite helps you write code faster by saving you keystokes and showing you the right information at the right time. Learn more about how Kite heightens VS Code's capabilities at https://kite.com/integrations/vs-code/.
![GitHub Repo stars](https://img.shields.io/github/stars/kiteco/vscode-plugin?style=social)
![Twitter Follow](https://img.shields.io/twitter/follow/kitehq?style=social)
![YouTube Video Views](https://img.shields.io/youtube/views/L2vpOL-jHpQ?label=Kite%20Youtube&style=social)
At a high level, Kite provides you with:
* 🧠 __[Line-of-Code Completions](https://kite.com/blog/product/launching-line-of-code-completions-going-cloudless-and-17-million-in-funding/)__ powered by machine learning models trained on over 25 million open-source code files
* 🔍 __[Instant documentation](https://kite.com/copilot/)__ for the symbol underneath your cursor so you save time searching for Python docs (not yet available for JavaScript docs)
Kite is an **AI-powered** programming assistant that helps you **write code faster inside Visual Studio Code**. Kite helps you write code faster by saving you keystrokes and showing you the right information at the right time.
**Kite works for all major programming languages:** Python, Java, Go, PHP, C/C#/C++, Javascript, HTML/CSS, Typescript, React, Ruby, Scala, Kotlin, Bash, Vue and React.
![kite vs no kite](https://kite-public-assets.s3-us-west-1.amazonaws.com/kite-public/plugin_vs/kite_vs_nokite.gif)
## Features
### Completions Powered by Machine Learning
Kites code completions are powered by **machine learning** models trained on over 25 million open-source code files. **Kite also runs locally**. Your code is private and does not leave your machine.
![](https://kite-public-assets.s3-us-west-1.amazonaws.com/kite-public/plugin-intellij/python_intellij_v1.gif)
### Instant Code Documentation
Get instant documentation for the symbol underneath your cursor so you save time searching for Python docs (not yet available for JavaScript docs).
![](https://kite-public-assets.s3-us-west-1.amazonaws.com/kite-public/plugin-intellij/kite_documentation.gif)
## Requirements

View File

@ -1,12 +0,0 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"lib": [
"es6"
]
},
"exclude": [
"node_modules"
]
}

View File

@ -1,16 +1,16 @@
{
"name": "kite",
"displayName": "Kite AI Code AutoComplete: Python, Java, Go, PHP, C/C#/C++, Javascript, HTML/CSS, Typescript, React, Ruby, Scala",
"description": "AI powered autocomplete, code snippets, code signatures, and cursor-following documentation for VS Code. Code faster, stay in flow.",
"version": "0.135.0",
"displayName": "Kite AutoComplete AI Code: Python, Java, Go, PHP, C/C#/C++, Javascript, HTML/CSS, Typescript, React, Ruby, Scala, Kotlin, Bash, Vue, React",
"description": "AI code completions for all languages, intellisense, code snippets, code signatures, and cursor-following documentation for VS Code. Kite supports .js .jsx .vue .tsx .ts .css .html .less .c .cc .cpp .cs .h .hpp .m .scala .java .kt .py .go .php .rb and .sh filetypes.",
"version": "0.136.0",
"publisher": "kiteco",
"engines": {
"vscode": "^1.34.0"
},
"icon": "logo.png",
"galleryBanner": {
"color": "#ffffff",
"theme": "light"
"color": "#11182F",
"theme": "dark"
},
"author": {
"name": "Kite"
@ -55,7 +55,30 @@
"objective-c",
"objectivec",
"ai",
"react"
"react",
".js",
".jsx",
".vue",
".tsx",
".ts",
".css",
".html",
".less",
".c",
".cc",
".cpp",
".cs",
".h",
".hpp",
".m",
".scala",
".java",
".kt",
".py",
".go",
".php",
".rb",
".sh"
],
"activationEvents": [
"*"
@ -365,8 +388,8 @@
"install-local": "vsce package && code --install-extension kite-*.vsix && rm kite-*.vsix"
},
"dependencies": {
"kite-api": "=3.19.0",
"kite-connector": "=3.12.0",
"kite-api": "=3.20.0",
"kite-connector": "=3.14.0",
"md5": "^2.2.0",
"mixpanel": "^0.5.0",
"open": "^7.3.0",

View File

@ -113,7 +113,7 @@ export default class KiteRelatedCodeDecorationsProvider {
}
private hoverMessage(hover: string): MarkdownString {
const logo = path.join(extensions.getExtension("kiteco.kite").extensionPath , "/dist/assets/images/logo-light-blue.svg");
const logo = path.join(extensions.getExtension("kiteco.kite").extensionPath, "dist", "assets", "images", "logo-light-blue.svg");
const md = new MarkdownString(`![KiteIcon](${logo}|height=10) [${hover}](command:kite.related-code-from-line)`);
// Must mark as trusted to run commands in MarkdownStrings
md.isTrusted = true;

View File

@ -86,10 +86,6 @@ export const Kite = {
vscode.workspace.getConfiguration("kite").loggingLevel.toUpperCase()
];
KiteAPI
.isKiteInstalled()
.catch(NotificationsManager.showKiteInstallNotification);
this.setMaxFileSize();
this.disposables.push(
@ -427,6 +423,7 @@ export const Kite = {
this.shown = {};
this.disposables = [];
this.attemptedToStartKite = false;
this.installing = false;
this.notifications = new NotificationsManager();
delete this.lastState;
delete this.lastStatus;
@ -522,12 +519,32 @@ export const Kite = {
return state;
}
this.shown[state] = true;
if (KiteAPI.hasKiteRun()) {
NotificationsManager.showKiteInstallNotification();
} else {
NotificationsManager.showKiteDownloadingNotification();
this.installing = true;
KiteAPI.downloadKiteRelease({
install: true,
launchCopilot: true,
channel: 'vscode',
onRemove: () => { this.installing = false; },
})
.catch(e => {
console.error(e);
NotificationsManager.showKiteInstallErrorNotification();
});
}
break;
case KiteAPI.STATES.INSTALLED:
if (
!this.attemptedToStartKite &&
vscode.workspace.getConfiguration("kite").startKiteEngineOnStartup
) {
if (this.installing) {
// Guard against running Kite before installation fully completes.
break;
}
KiteAPI.runKiteAndWait(RUN_KITE_ATTEMPTS, RUN_KITE_INTERVAL).then(() => this.checkState(src));
this.attemptedToStartKite = true;
}
@ -586,14 +603,19 @@ export const Kite = {
this.statusBarItem.show();
switch (state) {
case KiteAPI.STATES.UNSUPPORTED:
this.statusBarItem.text = "𝕜𝕚𝕥𝕖: not supported";
this.statusBarItem.tooltip =
"Kite engine is currently not supported on your platform";
this.statusBarItem.color = ERROR_COLOR();
this.statusBarItem.text = "𝕜𝕚𝕥𝕖: not supported";
break;
case KiteAPI.STATES.UNINSTALLED:
this.statusBarItem.text = "𝕜𝕚𝕥𝕖: not installed";
this.statusBarItem.tooltip = "Kite engine is not installed";
if (this.installing) {
this.statusBarItem.text = "𝕜𝕚𝕥𝕖: installing components";
this.statusBarItem.tooltip = "Installing components. Kite will launch automatically when ready.";
} else {
this.statusBarItem.text = "𝕜𝕚𝕥𝕖: not installed";
this.statusBarItem.tooltip = "Kite engine is not installed";
}
this.statusBarItem.color = ERROR_COLOR();
break;
case KiteAPI.STATES.INSTALLED:

View File

@ -1,6 +1,5 @@
import vscode from "vscode";
import open from "open";
import path from "path";
import metrics from "./metrics";
@ -78,22 +77,56 @@ export default class NotificationsManager {
.then(hasDone => !hasDone && openKiteTutorial('python'));
}
static showKiteInstallNotification(err) {
if (typeof err.data !== 'undefined' && err.data.state === KiteAPI.STATES.UNINSTALLED) {
metrics.track("vscode_kite_installer_notification_shown");
vscode.window
.showInformationMessage(
"Kite requires the Kite Engine backend to provide completions and documentation. Please install it to use Kite.",
"Install"
)
.then(item => {
switch (item) {
case "Install":
open("https://www.kite.com/install/?utm_medium=editor&utm_source=vscode");
metrics.track("vscode_kite_installer_github_link_clicked");
break;
}
});
}
static showKiteInstallNotification() {
metrics.track("vscode_kite_installer_notification_shown");
vscode.window
.showInformationMessage(
"Kite requires the Kite Engine backend to provide completions and documentation. Please install it to use Kite.",
"Install"
)
.then(item => {
switch (item) {
case "Install":
open("https://www.kite.com/install/?utm_medium=editor&utm_source=vscode");
metrics.track("vscode_kite_installer_github_link_clicked");
break;
}
});
}
static showKiteDownloadingNotification() {
metrics.track("vscode_kite_downloading_notification_shown");
vscode.window
.showInformationMessage(
"Kite ships with a standalone application called the Copilot that can show you documentation while you code. The Copilot will launch automatically after Kite is finished installing.",
"OK",
"Learn More"
)
.then(item => {
switch (item) {
case "OK":
break;
case "Learn More":
open("https://www.kite.com/copilot/");
break;
}
});
}
static showKiteInstallErrorNotification() {
metrics.track("vscode_kite_downloading_failed_notification_shown");
vscode.window
.showErrorMessage(
"There was an error installing the Kite Engine, which is required for Kite to provide completions and documentation. Please install it to use Kite.",
"Install"
)
.then(item => {
switch (item) {
case "Install":
open("https://www.kite.com/install/?utm_medium=editor&utm_source=vscode");
metrics.track("vscode_kite_installer_github_link_clicked");
break;
}
});
}
}