Skip to content

Commit

Permalink
Update inline suggestion service name (#851)
Browse files Browse the repository at this point in the history
* Update inline suggestion service name

Change `Project Wisdom` name to `Ansible Lightspeed`
and inline suggestion related feature name to
`Ansible Lightspeed with Watson Code Assistant`

* Update description

* chore: auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* update error message

* fix typo

* fix typo

* fix review comments

* more review comments

* update settings from url to URL

* fix typo in comments

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
ganeshrn and pre-commit-ci[bot] authored Apr 14, 2023
1 parent ba9c9a8 commit 9a8aa05
Show file tree
Hide file tree
Showing 18 changed files with 396 additions and 251 deletions.
1 change: 1 addition & 0 deletions .config/dictionary.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ keyfile
keyrings
lextudio
libyaml
lightspeed
liveserver
loglevel
lxml
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,10 @@ any level (User, Remote, Workspace and/or Folder).
completing module options.
- `ansibleServer.trace.server`: Traces the communication between VSCode and the
ansible language server.
- `ansible.lightspeed.enabled`: Enable Ansible Lightspeed.
- `ansible.lightspeed.URL`: URL for Ansible Lightspeed.
- `ansible.lightspeed.suggestions.enabled`: Enable Ansible Lightspeed with
Watson Code Assistant inline suggestions.

## Data and Telemetry

Expand Down
107 changes: 106 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,47 @@
}
],
"contributes": {
"viewsContainers": {
"activitybar": [
{
"id": "ansible-lightspeed-explorer",
"title": "Ansible",
"icon": "images/ansible.svg"
}
],
"panel": [
{
"id": "lightspeed-training-match-panel",
"title": "Ansible",
"icon": "images/ansible.svg"
}
]
},
"views": {
"ansible-lightspeed-explorer": [
{
"id": "lightspeed-explorer-treeview",
"name": "Ansible Lightspeed"
}
],
"lightspeed-training-match-panel": [
{
"id": "ansible.lightspeed.trainingMatchPanel",
"name": "Lightspeed Training Matches",
"type": "webview",
"contextualTitle": "Ansible",
"when": "config.ansible.lightspeed.enabled && config.ansible.lightspeed.suggestions.enabled",
"visibility": "visible",
"retainContextWhenHidden": true
}
]
},
"viewsWelcome": [
{
"view": "lightspeed-explorer-treeview",
"contents": "Welcome to Ansible Lightspeed for Visual Studio Code.\nExperience smarter automation using Ansible Lightspeed with Watson Code Assistant solutions for your playbook. [Learn more](https://www.redhat.com/en/engage/project-wisdom)\nLet's simplify your workflow by connecting VS Code with Ansible Lightspeed.\n[Connect](command:ansible.lightspeed.oauth)"
}
],
"jsonValidation": [
{
"fileMatch": [
Expand Down Expand Up @@ -144,6 +185,26 @@
"category": "%commands.category.ansible-vault%",
"command": "extension.ansible.vault",
"title": "%commands.title.ansible-vault%"
},
{
"command": "ansible.lightspeed.inlineSuggest.accept",
"title": "Ansible Lightspeed: Inline suggestion accept"
},
{
"command": "ansible.lightspeed.inlineSuggest.hide",
"title": "Ansible Lightspeed: Inline suggestion hide"
},
{
"command": "ansible.lightspeed.inlineSuggest.trigger",
"title": "Ansible Lightspeed: Inline suggestion trigger"
},
{
"command": "ansible.lightspeed.fetchTrainingMatches",
"title": "Ansible Lightspeed: Fetch Training Matches"
},
{
"command": "ansible.lightspeed.clearTrainingMatches",
"title": "Ansible Lightspeed: Clear Training Matches"
}
],
"configuration": {
Expand Down Expand Up @@ -329,6 +390,27 @@
],
"scope": "window",
"order": 20
},
"ansible.lightspeed.enabled": {
"scope": "resource",
"type": "boolean",
"default": false,
"markdownDescription": "Enable Ansible Lightspeed.",
"order": 21
},
"ansible.lightspeed.URL": {
"scope": "resource",
"type": "string",
"default": "https://c.ai.ansible.redhat.com",
"markdownDescription": "URL for Ansible Lightspeed.",
"order": 22
},
"ansible.lightspeed.suggestions.enabled": {
"scope": "resource",
"type": "boolean",
"default": false,
"markdownDescription": "Enable Ansible Lightspeed with Watson Code Assistant inline suggestions.",
"order": 23
}
}
},
Expand All @@ -344,6 +426,29 @@
}
}
},
"keybindings": [
{
"key": "tab",
"command": "ansible.lightspeed.inlineSuggest.accept",
"extensionName": "Ansible",
"source": "extension",
"when": "inlineSuggestionVisible && editorLangId == 'ansible'"
},
{
"key": "escape",
"command": "ansible.lightspeed.inlineSuggest.hide",
"extensionName": "Ansible",
"source": "extension",
"when": "inlineSuggestionVisible && editorLangId == 'ansible'"
},
{
"key": "ctrl+.",
"command": "ansible.lightspeed.inlineSuggest.trigger",
"extensionName": "Ansible",
"source": "extension",
"when": "config.ansible.lightspeed.enabled && config.ansible.lightspeed.suggestions.enabled && editorTextFocus && !editorHasSelection && !inlineSuggestionVisible && editorLangId == 'ansible'"
}
],
"languages": [
{
"id": "ansible",
Expand Down Expand Up @@ -589,7 +694,7 @@
"test-e2e": "yarn run test-compile && node ./out/client/test/testRunner",
"test-e2e-withserver": "yarn run test-compile-withserver && node ./out/client/test/testRunner"
},
"version": "1.3.0",
"version": "2.0.0",
"packageManager": "[email protected]",
"vsce": {
"dependencies": false,
Expand Down
50 changes: 27 additions & 23 deletions src/definitions/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,33 +7,37 @@ export namespace AnsibleCommands {
}

// eslint-disable-next-line @typescript-eslint/no-namespace
export namespace WisdomCommands {
export const WISDOM_AUTH_REQUEST = "ansible.wisdom.oauth";
export const WISDOM_SUGGESTION_COMMIT = "ansible.wisdom.inlineSuggest.accept";
export const WISDOM_SUGGESTION_HIDE = "ansible.wisdom.inlineSuggest.hide";
export const WISDOM_SUGGESTION_TRIGGER =
"ansible.wisdom.inlineSuggest.trigger";
export const WISDOM_STATUS_BAR_CLICK = "ansible.wisdom.statusBar.click";
export const WISDOM_FETCH_TRAINING_MATCHES =
"ansible.wisdom.fetchTrainingMatches";
export const WISDOM_CLEAR_TRAINING_MATCHES =
"ansible.wisdom.clearTrainingMatches";
export namespace LightSpeedCommands {
export const LIGHTSPEED_AUTH_REQUEST = "ansible.lightspeed.oauth";
export const LIGHTSPEED_SUGGESTION_COMMIT =
"ansible.lightspeed.inlineSuggest.accept";
export const LIGHTSPEED_SUGGESTION_HIDE =
"ansible.lightspeed.inlineSuggest.hide";
export const LIGHTSPEED_SUGGESTION_TRIGGER =
"ansible.lightspeed.inlineSuggest.trigger";
export const LIGHTSPEED_STATUS_BAR_CLICK =
"ansible.lightspeed.statusBar.click";
export const LIGHTSPEED_FETCH_TRAINING_MATCHES =
"ansible.lightspeed.fetchTrainingMatches";
export const LIGHTSPEED_CLEAR_TRAINING_MATCHES =
"ansible.lightspeed.clearTrainingMatches";
}

export const WISDOM_API_VERSION = "v0";
export const WISDOM_SUGGESTION_COMPLETION_URL = `${WISDOM_API_VERSION}/ai/completions/`;
export const WISDOM_SUGGESTION_FEEDBACK_URL = `${WISDOM_API_VERSION}/ai/feedback/`;
export const WISDOM_SUGGESTION_ATTRIBUTIONS_URL = `${WISDOM_API_VERSION}/ai/attributions/`;
export const WISDOM_ME_AUTH_URL = `/api/${WISDOM_API_VERSION}/me/`;
export const LIGHTSPEED_API_VERSION = "v0";
export const LIGHTSPEED_SUGGESTION_COMPLETION_URL = `${LIGHTSPEED_API_VERSION}/ai/completions/`;
export const LIGHTSPEED_SUGGESTION_FEEDBACK_URL = `${LIGHTSPEED_API_VERSION}/ai/feedback/`;
export const LIGHTSPEED_SUGGESTION_ATTRIBUTIONS_URL = `${LIGHTSPEED_API_VERSION}/ai/attributions/`;
export const LIGHTSPEED_ME_AUTH_URL = `/api/${LIGHTSPEED_API_VERSION}/me/`;

export const WISDOM_FEEDBACK_FORM_URL = "https://red.ht/ansible-ai-feedback";
export const LIGHTSPEED_FEEDBACK_FORM_URL =
"https://red.ht/ansible-ai-feedback";

export const WISDOM_REPORT_EMAIL_ADDRESS = "[email protected]";
export const WISDOM_STATUS_BAR_CLICK_HANDLER =
"ansible.wisdom.statusBar.clickHandler";
export const LIGHTSPEED_REPORT_EMAIL_ADDRESS = "[email protected]";
export const LIGHTSPEED_STATUS_BAR_CLICK_HANDLER =
"ansible.lightspeed.statusBar.clickHandler";

export const WISDOM_FEEDBACK_URL =
export const LIGHTSPEED_FEEDBACK_URL =
"https://redhatdg.co1.qualtrics.com/jfe/form/SV_e99JvA2DHp5UlWC";

export const WISDOM_CLIENT_ID = "Vu2gClkeR5qUJTUGHoFAePmBznd6RZjDdy5FW2wy";
export const WISDOM_SERVICE_LOGIN_TIMEOUT = 120000;
export const LIGHTSPEED_CLIENT_ID = "Vu2gClkeR5qUJTUGHoFAePmBznd6RZjDdy5FW2wy";
export const LIGHTSPEED_SERVICE_LOGIN_TIMEOUT = 120000;
File renamed without changes.
Loading

0 comments on commit 9a8aa05

Please sign in to comment.