Skip to content

Commit 9a42eab

Browse files
apaniukovyatarkan
andauthored
OpenVINO Code VSCode Extension (#713)
* OpenVINO Code Init Commit * Add openvino code module to readme * Remove empty license file --------- Co-authored-by: yatarkan <yaroslav.tarkan@intel.com>
1 parent 075927b commit 9a42eab

File tree

104 files changed

+18850
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+18850
-0
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ This list gives an overview of all modules available inside the contrib reposito
1212
* [**java_api**](./modules/java_api): Inference Engine Java API -- provides Java wrappers for Inference Engine public API.
1313
* [**custom_operations**](./modules/custom_operations/): Collection of Custom Operations -- implement Custom Operations with OpenVINO Extensibility Mechanism.
1414
* [**Token Merging**](./modules/token_merging/): adaptation of [Token Merging method](https://arxiv.org/abs/2210.09461) for OpenVINO.
15+
* [**OpenVINO Code**](./modules/openvino_code): VSCode extension for AI code completion with OpenVINO.
1516

1617
## How to build OpenVINO with extra modules
1718
You can build OpenVINO, so it will include the modules from this repository. Contrib modules are under constant development and it is recommended to use them alongside the master branch or latest releases of OpenVINO.

modules/openvino_code/.eslintignore

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# don't ever lint node_modules
2+
node_modules
3+
# don't lint build output (make sure it's set to your correct build folder name)
4+
dist
5+
out
6+
# don't lint nyc coverage output
7+
coverage
8+
.eslintrc.js

modules/openvino_code/.eslintrc.js

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
module.exports = {
2+
root: true,
3+
env: {
4+
node: true,
5+
es2021: true,
6+
},
7+
extends: [
8+
'airbnb-typescript/base',
9+
'eslint:recommended',
10+
'plugin:@typescript-eslint/recommended-requiring-type-checking',
11+
'plugin:import/errors',
12+
'plugin:import/typescript',
13+
'prettier',
14+
],
15+
parser: '@typescript-eslint/parser',
16+
parserOptions: {
17+
project: './tsconfig.json',
18+
tsconfigRootDir: __dirname,
19+
},
20+
plugins: ['@typescript-eslint', 'import'],
21+
rules: {
22+
'no-console': ['error', { allow: ['warn', 'error'] }],
23+
'@typescript-eslint/naming-convention': 'warn',
24+
'no-unused-vars': 'off',
25+
'@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
26+
'@typescript-eslint/lines-between-class-members': 'off',
27+
'@typescript-eslint/restrict-template-expressions': 'error',
28+
'@typescript-eslint/no-use-before-define': ['error', { functions: false, classes: false }],
29+
'import/no-unresolved': 'error',
30+
'import/no-extraneous-dependencies': ['error', { devDependencies: true }],
31+
},
32+
settings: {
33+
'import/resolver': {
34+
typescript: {
35+
alwaysTryTypes: true,
36+
},
37+
},
38+
},
39+
overrides: [
40+
{
41+
files: ['*.js'],
42+
rules: {
43+
'@typescript-eslint/no-var-requires': 'off',
44+
},
45+
},
46+
],
47+
ignorePatterns: ['out', 'dist', 'server', '**/*.d.ts'],
48+
};

modules/openvino_code/.gitignore

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
**/node_modules
2+
**/out
3+
dist
4+
5+
.vscode-test/
6+
**.DS_Store
7+
binaries/*
8+
9+
registration_key
10+
auth
11+
sig
12+
13+
14+
.idea/
15+
*.iml
16+
17+
**/assistant-cache
18+
**/assistant-binaries
19+
venv
20+
.venv
21+
/server/venv/
22+
/server/.venv/
23+
/server/models/
24+
/server/src/__pycache__
25+
**/build
26+
/server/OVCodExtServer.egg-info/
27+
/server/src/OVCodExtServer.egg-info/
28+
/server/.ruff_cache/

modules/openvino_code/.prettierignore

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Ignore artifacts:
2+
build
3+
coverage
4+
out
5+
dist
6+
./server/
7+
assets
8+
binaries
9+
node_modules
10+
.vscode
11+
.github

modules/openvino_code/.prettierrc

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"printWidth": 120,
3+
"trailingComma": "es5",
4+
"useTabs": false,
5+
"tabWidth": 2,
6+
"semi": true,
7+
"bracketSpacing": true,
8+
"singleQuote": true,
9+
"arrowParens": "always"
10+
}

modules/openvino_code/.vscodeignore

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
**
2+
!media/logo.png
3+
!media/sidebar-icon.png
4+
!out/
5+
!out/extension.js
6+
!side-panel-ui/dist/
7+
!package.json
8+
!LICENSE
9+
!README.md

modules/openvino_code/README.md

+75
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# OpenVINO Code - VSCode extension for AI code completion with OpenVINO™
2+
3+
VSCode extension for helping developers writing code with AI code assistant. OpenVINO Code is working with Large Language Model for Code (Code LLM) deployed on local or remote server.
4+
5+
## Installing Extension
6+
7+
VSCode extension can be installed from built `*.vsix` file:
8+
9+
1. Open `Extensions` side bar in VSCode.
10+
2. Click on the menu icon (three dots menu icon aka "meatballs" icon) in the top right corner of Extensions side panel.
11+
3. Select "Instal from VSIX..." option and select extension file.
12+
13+
For instructions on how to build extension `vsix` file please refer to the [Build Extension](#build-extension) section.
14+
15+
## Extension Configuration
16+
17+
To work with extension you should configure endpoint to server with Code LLM where requests will be sent:
18+
19+
1. Open extension settings.
20+
2. Fill `Server URL` parameter with server endpoint URL.
21+
22+
For instructions on how to start server locally please refer to the [server README.md](./server/README.md).
23+
24+
Also in extension settings you can configure special tokens.
25+
26+
## Working with Extension
27+
28+
TDB
29+
30+
1. Create a new python file
31+
2. Try typing `def main():`
32+
3. Press shortcut buttons (TBD) for code completion
33+
34+
### Checking output
35+
36+
You can see input to and output from the code generation API:
37+
38+
1. Open VSCode `OUTPUT` panel
39+
2. Select extension output source from the dropdown menu
40+
41+
## Developing
42+
43+
> **Prerequisite:** You should have `Node.js` installed (v16 and above).
44+
45+
#### Install dependencies
46+
47+
To install dependencies run the following command from the project root directory:
48+
49+
```
50+
npm install
51+
```
52+
53+
#### Run Extension from Source & Debugging
54+
55+
Open `Run and Debug` side bar in VSCode and click `Launch Extension` (or press `F5`).
56+
57+
#### Build Extension
58+
59+
To build extension and generate `*.vsix` file for further installation in VSCode, run the following command:
60+
61+
```
62+
npm run vsce:package
63+
```
64+
65+
#### Linting
66+
67+
To perform linting with `ESLint`, execute the following command:
68+
69+
```
70+
npm run lint
71+
```
72+
73+
#### Testing
74+
75+
TBD

modules/openvino_code/jest.config.js

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module.exports = {
2+
transform: {
3+
"^.+\\.ts?$": "ts-jest",
4+
},
5+
testRegex: "(/__tests__/.*|\\.(test|spec))\\.[tj]sx?$",
6+
moduleFileExtensions: ["ts", "tsx", "js", "jsx", "json", "node"],
7+
testEnvironment: "node",
8+
};
Binary file not shown.

0 commit comments

Comments
 (0)