Skip to content

Commit 9a8aa05

Browse files
Update inline suggestion service name (#851)
* 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>
1 parent ba9c9a8 commit 9a8aa05

18 files changed

Lines changed: 396 additions & 251 deletions

.config/dictionary.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ keyfile
6363
keyrings
6464
lextudio
6565
libyaml
66+
lightspeed
6667
liveserver
6768
loglevel
6869
lxml

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,10 @@ any level (User, Remote, Workspace and/or Folder).
213213
completing module options.
214214
- `ansibleServer.trace.server`: Traces the communication between VSCode and the
215215
ansible language server.
216+
- `ansible.lightspeed.enabled`: Enable Ansible Lightspeed.
217+
- `ansible.lightspeed.URL`: URL for Ansible Lightspeed.
218+
- `ansible.lightspeed.suggestions.enabled`: Enable Ansible Lightspeed with
219+
Watson Code Assistant inline suggestions.
216220

217221
## Data and Telemetry
218222

package.json

Lines changed: 106 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,47 @@
4444
}
4545
],
4646
"contributes": {
47+
"viewsContainers": {
48+
"activitybar": [
49+
{
50+
"id": "ansible-lightspeed-explorer",
51+
"title": "Ansible",
52+
"icon": "images/ansible.svg"
53+
}
54+
],
55+
"panel": [
56+
{
57+
"id": "lightspeed-training-match-panel",
58+
"title": "Ansible",
59+
"icon": "images/ansible.svg"
60+
}
61+
]
62+
},
63+
"views": {
64+
"ansible-lightspeed-explorer": [
65+
{
66+
"id": "lightspeed-explorer-treeview",
67+
"name": "Ansible Lightspeed"
68+
}
69+
],
70+
"lightspeed-training-match-panel": [
71+
{
72+
"id": "ansible.lightspeed.trainingMatchPanel",
73+
"name": "Lightspeed Training Matches",
74+
"type": "webview",
75+
"contextualTitle": "Ansible",
76+
"when": "config.ansible.lightspeed.enabled && config.ansible.lightspeed.suggestions.enabled",
77+
"visibility": "visible",
78+
"retainContextWhenHidden": true
79+
}
80+
]
81+
},
82+
"viewsWelcome": [
83+
{
84+
"view": "lightspeed-explorer-treeview",
85+
"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)"
86+
}
87+
],
4788
"jsonValidation": [
4889
{
4990
"fileMatch": [
@@ -144,6 +185,26 @@
144185
"category": "%commands.category.ansible-vault%",
145186
"command": "extension.ansible.vault",
146187
"title": "%commands.title.ansible-vault%"
188+
},
189+
{
190+
"command": "ansible.lightspeed.inlineSuggest.accept",
191+
"title": "Ansible Lightspeed: Inline suggestion accept"
192+
},
193+
{
194+
"command": "ansible.lightspeed.inlineSuggest.hide",
195+
"title": "Ansible Lightspeed: Inline suggestion hide"
196+
},
197+
{
198+
"command": "ansible.lightspeed.inlineSuggest.trigger",
199+
"title": "Ansible Lightspeed: Inline suggestion trigger"
200+
},
201+
{
202+
"command": "ansible.lightspeed.fetchTrainingMatches",
203+
"title": "Ansible Lightspeed: Fetch Training Matches"
204+
},
205+
{
206+
"command": "ansible.lightspeed.clearTrainingMatches",
207+
"title": "Ansible Lightspeed: Clear Training Matches"
147208
}
148209
],
149210
"configuration": {
@@ -329,6 +390,27 @@
329390
],
330391
"scope": "window",
331392
"order": 20
393+
},
394+
"ansible.lightspeed.enabled": {
395+
"scope": "resource",
396+
"type": "boolean",
397+
"default": false,
398+
"markdownDescription": "Enable Ansible Lightspeed.",
399+
"order": 21
400+
},
401+
"ansible.lightspeed.URL": {
402+
"scope": "resource",
403+
"type": "string",
404+
"default": "https://c.ai.ansible.redhat.com",
405+
"markdownDescription": "URL for Ansible Lightspeed.",
406+
"order": 22
407+
},
408+
"ansible.lightspeed.suggestions.enabled": {
409+
"scope": "resource",
410+
"type": "boolean",
411+
"default": false,
412+
"markdownDescription": "Enable Ansible Lightspeed with Watson Code Assistant inline suggestions.",
413+
"order": 23
332414
}
333415
}
334416
},
@@ -344,6 +426,29 @@
344426
}
345427
}
346428
},
429+
"keybindings": [
430+
{
431+
"key": "tab",
432+
"command": "ansible.lightspeed.inlineSuggest.accept",
433+
"extensionName": "Ansible",
434+
"source": "extension",
435+
"when": "inlineSuggestionVisible && editorLangId == 'ansible'"
436+
},
437+
{
438+
"key": "escape",
439+
"command": "ansible.lightspeed.inlineSuggest.hide",
440+
"extensionName": "Ansible",
441+
"source": "extension",
442+
"when": "inlineSuggestionVisible && editorLangId == 'ansible'"
443+
},
444+
{
445+
"key": "ctrl+.",
446+
"command": "ansible.lightspeed.inlineSuggest.trigger",
447+
"extensionName": "Ansible",
448+
"source": "extension",
449+
"when": "config.ansible.lightspeed.enabled && config.ansible.lightspeed.suggestions.enabled && editorTextFocus && !editorHasSelection && !inlineSuggestionVisible && editorLangId == 'ansible'"
450+
}
451+
],
347452
"languages": [
348453
{
349454
"id": "ansible",
@@ -589,7 +694,7 @@
589694
"test-e2e": "yarn run test-compile && node ./out/client/test/testRunner",
590695
"test-e2e-withserver": "yarn run test-compile-withserver && node ./out/client/test/testRunner"
591696
},
592-
"version": "1.3.0",
697+
"version": "2.0.0",
593698
"packageManager": "yarn@3.5.0",
594699
"vsce": {
595700
"dependencies": false,

src/definitions/constants.ts

Lines changed: 27 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -7,33 +7,37 @@ export namespace AnsibleCommands {
77
}
88

99
// eslint-disable-next-line @typescript-eslint/no-namespace
10-
export namespace WisdomCommands {
11-
export const WISDOM_AUTH_REQUEST = "ansible.wisdom.oauth";
12-
export const WISDOM_SUGGESTION_COMMIT = "ansible.wisdom.inlineSuggest.accept";
13-
export const WISDOM_SUGGESTION_HIDE = "ansible.wisdom.inlineSuggest.hide";
14-
export const WISDOM_SUGGESTION_TRIGGER =
15-
"ansible.wisdom.inlineSuggest.trigger";
16-
export const WISDOM_STATUS_BAR_CLICK = "ansible.wisdom.statusBar.click";
17-
export const WISDOM_FETCH_TRAINING_MATCHES =
18-
"ansible.wisdom.fetchTrainingMatches";
19-
export const WISDOM_CLEAR_TRAINING_MATCHES =
20-
"ansible.wisdom.clearTrainingMatches";
10+
export namespace LightSpeedCommands {
11+
export const LIGHTSPEED_AUTH_REQUEST = "ansible.lightspeed.oauth";
12+
export const LIGHTSPEED_SUGGESTION_COMMIT =
13+
"ansible.lightspeed.inlineSuggest.accept";
14+
export const LIGHTSPEED_SUGGESTION_HIDE =
15+
"ansible.lightspeed.inlineSuggest.hide";
16+
export const LIGHTSPEED_SUGGESTION_TRIGGER =
17+
"ansible.lightspeed.inlineSuggest.trigger";
18+
export const LIGHTSPEED_STATUS_BAR_CLICK =
19+
"ansible.lightspeed.statusBar.click";
20+
export const LIGHTSPEED_FETCH_TRAINING_MATCHES =
21+
"ansible.lightspeed.fetchTrainingMatches";
22+
export const LIGHTSPEED_CLEAR_TRAINING_MATCHES =
23+
"ansible.lightspeed.clearTrainingMatches";
2124
}
2225

23-
export const WISDOM_API_VERSION = "v0";
24-
export const WISDOM_SUGGESTION_COMPLETION_URL = `${WISDOM_API_VERSION}/ai/completions/`;
25-
export const WISDOM_SUGGESTION_FEEDBACK_URL = `${WISDOM_API_VERSION}/ai/feedback/`;
26-
export const WISDOM_SUGGESTION_ATTRIBUTIONS_URL = `${WISDOM_API_VERSION}/ai/attributions/`;
27-
export const WISDOM_ME_AUTH_URL = `/api/${WISDOM_API_VERSION}/me/`;
26+
export const LIGHTSPEED_API_VERSION = "v0";
27+
export const LIGHTSPEED_SUGGESTION_COMPLETION_URL = `${LIGHTSPEED_API_VERSION}/ai/completions/`;
28+
export const LIGHTSPEED_SUGGESTION_FEEDBACK_URL = `${LIGHTSPEED_API_VERSION}/ai/feedback/`;
29+
export const LIGHTSPEED_SUGGESTION_ATTRIBUTIONS_URL = `${LIGHTSPEED_API_VERSION}/ai/attributions/`;
30+
export const LIGHTSPEED_ME_AUTH_URL = `/api/${LIGHTSPEED_API_VERSION}/me/`;
2831

29-
export const WISDOM_FEEDBACK_FORM_URL = "https://red.ht/ansible-ai-feedback";
32+
export const LIGHTSPEED_FEEDBACK_FORM_URL =
33+
"https://red.ht/ansible-ai-feedback";
3034

31-
export const WISDOM_REPORT_EMAIL_ADDRESS = "ansible-content-ai@redhat.com";
32-
export const WISDOM_STATUS_BAR_CLICK_HANDLER =
33-
"ansible.wisdom.statusBar.clickHandler";
35+
export const LIGHTSPEED_REPORT_EMAIL_ADDRESS = "ansible-content-ai@redhat.com";
36+
export const LIGHTSPEED_STATUS_BAR_CLICK_HANDLER =
37+
"ansible.lightspeed.statusBar.clickHandler";
3438

35-
export const WISDOM_FEEDBACK_URL =
39+
export const LIGHTSPEED_FEEDBACK_URL =
3640
"https://redhatdg.co1.qualtrics.com/jfe/form/SV_e99JvA2DHp5UlWC";
3741

38-
export const WISDOM_CLIENT_ID = "Vu2gClkeR5qUJTUGHoFAePmBznd6RZjDdy5FW2wy";
39-
export const WISDOM_SERVICE_LOGIN_TIMEOUT = 120000;
42+
export const LIGHTSPEED_CLIENT_ID = "Vu2gClkeR5qUJTUGHoFAePmBznd6RZjDdy5FW2wy";
43+
export const LIGHTSPEED_SERVICE_LOGIN_TIMEOUT = 120000;

0 commit comments

Comments
 (0)