Skip to content

Commit 1a9611f

Browse files
committed
Merge remote-tracking branch 'upstream/feature/vector-custom' into feature/vector
2 parents dda8a6a + 7e25f9e commit 1a9611f

12 files changed

+78
-41
lines changed

.changes/1.94.0.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"date": "2023-10-12",
3+
"version": "1.94.0",
4+
"entries": [
5+
{
6+
"type": "Feature",
7+
"description": "CodeWhisperer: improve auto-suggestions for additional languages"
8+
},
9+
{
10+
"type": "Feature",
11+
"description": "StepFunctions: Support rendering SFN graph with ItemProcessor field"
12+
},
13+
{
14+
"type": "Feature",
15+
"description": "auth: Adding or switching connections in CodeWhisperer, CodeCatalyst and Explorer is now faster and requires fewer steps"
16+
}
17+
]
18+
}

.changes/next-release/Feature-0cd31fc0-2e29-4295-83a3-f4cb7eeaa325.json

Lines changed: 0 additions & 4 deletions
This file was deleted.

.changes/next-release/Feature-3d9dd25d-a1c3-40a8-b520-a19b339bd4dd.json

Lines changed: 0 additions & 4 deletions
This file was deleted.

.changes/next-release/Feature-93736bc9-dfa0-4698-924d-0f1d8a119c85.json

Lines changed: 0 additions & 4 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## 1.94.0 2023-10-12
2+
3+
- **Feature** CodeWhisperer: improve auto-suggestions for additional languages
4+
- **Feature** StepFunctions: Support rendering SFN graph with ItemProcessor field
5+
- **Feature** auth: Adding or switching connections in CodeWhisperer, CodeCatalyst and Explorer is now faster and requires fewer steps
6+
17
## 1.93.0 2023-10-05
28

39
- **Bug Fix** SAM: local debugging of a .NET lambda may fail if `containerbuild=true`

docs/api.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@ Details about any publicly accessible functionalities exposed through [extension
88

99
#### `aws.codeWhisperer.connect`
1010

11-
**Signature**: _async (startUrl?: string, region?: string) => Promise<void>_
11+
**Signature**: _async (startUrl?: string, region?: string, customizationArn?: string, customizationName?: string, customizationDescription?: string) => Promise<void>_
1212

13-
Shortcut command to directly connect to Identity Center or prompt start URL entry, as well as set a customization for CodeWhisperer requests. Customization is not yet supported.
13+
Shortcut command to directly connect to Identity Center or prompt start URL entry, as well as set a customization for CodeWhisperer requests.
1414

15-
This command expects two arguments: startUrl and region (both strings).
16-
If these arguments are provided, they will be used. Otherwise, the commands prompts for them interactively.
15+
This command supports two sets of arguments:
16+
17+
- startUrl and region. If both arguments are provided they will be used, otherwise the command prompts for them interactively.
18+
- customization{Arn, Name, Description}. If at least customizationArn is provided, the command selects this customization.

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "aws-toolkit-vscode",
33
"displayName": "AWS Toolkit",
44
"description": "Including CodeWhisperer, CodeCatalyst, and support for Lambda, S3, CloudWatch Logs, and many other services",
5-
"version": "1.94.0-SNAPSHOT",
5+
"version": "1.95.0-SNAPSHOT",
66
"extensionKind": [
77
"workspace"
88
],

src/codewhisperer/activation.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ import {
3333
showIntroduction,
3434
reconnect,
3535
refreshStatusBar,
36-
selectCustomization,
36+
selectCustomizationPrompt,
3737
notifyNewCustomizationsCmd,
38-
connectIdCenter,
38+
connectWithCustomization,
3939
} from './commands/basicCommands'
4040
import { sleep } from '../shared/utilities/timeoutUtils'
4141
import { ReferenceLogViewProvider } from './service/referenceLogViewProvider'
@@ -159,8 +159,8 @@ export async function activate(context: ExtContext): Promise<void> {
159159
}),
160160
// show introduction
161161
showIntroduction.register(),
162-
// CodeWhisperer Identity Center connection setup
163-
connectIdCenter.register(),
162+
// direct CodeWhisperer connection setup with customization
163+
connectWithCustomization.register(),
164164
// toggle code suggestions
165165
toggleCodeSuggestions.register(context.extensionContext.globalState),
166166
// enable code suggestions
@@ -184,7 +184,7 @@ export async function activate(context: ExtContext): Promise<void> {
184184
invokeRecommendation(vscode.window.activeTextEditor as vscode.TextEditor, client, await getConfigEntry())
185185
}),
186186
// select customization
187-
selectCustomization.register(),
187+
selectCustomizationPrompt.register(),
188188
// notify new customizations
189189
notifyNewCustomizationsCmd.register(),
190190
/**

src/codewhisperer/commands/basicCommands.ts

Lines changed: 37 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,12 @@ import { AuthUtil } from '../util/authUtil'
1919
import { isCloud9 } from '../../shared/extensionUtilities'
2020
import { InlineCompletionService } from '../service/inlineCompletionService'
2121
import { openUrl } from '../../shared/utilities/vsCodeUtils'
22-
import { notifyNewCustomizations, showCustomizationPrompt } from '../util/customizationUtil'
22+
import {
23+
getPersistedCustomizations,
24+
notifyNewCustomizations,
25+
selectCustomization,
26+
showCustomizationPrompt,
27+
} from '../util/customizationUtil'
2328
import { get, set } from '../util/commonUtil'
2429
import { CodeWhispererCommandDeclarations } from '../commands/gettingStartedPageCommands'
2530
import { getIcon } from '../../shared/icons'
@@ -40,7 +45,7 @@ export const toggleCodeSuggestions = Commands.declare(
4045
})
4146
}
4247
)
43-
/*
48+
/*
4449
createGettingStartedNode(Learn) will be a childnode of CodeWhisperer
4550
onClick on this "Learn" Node will open the Learn CodeWhisperer Page.
4651
*/
@@ -100,7 +105,7 @@ export const showSecurityScan = Commands.declare(
100105
}
101106
)
102107

103-
export const selectCustomization = Commands.declare('aws.codeWhisperer.selectCustomization', () => async () => {
108+
export const selectCustomizationPrompt = Commands.declare('aws.codeWhisperer.selectCustomization', () => async () => {
104109
telemetry.ui_click.emit({ elementId: 'cw_selectCustomization_Cta' })
105110
showCustomizationPrompt().then()
106111
})
@@ -115,19 +120,37 @@ export const showSsoSignIn = Commands.declare('aws.codeWhisperer.sso', () => asy
115120
})
116121

117122
// Shortcut command to directly connect to Identity Center or prompt start URL entry
118-
// Customization is not yet supported.
119-
export const connectIdCenter = Commands.declare(
123+
// It can optionally set a customization too.
124+
export const connectWithCustomization = Commands.declare(
120125
'aws.codeWhisperer.connect',
121-
() => async (startUrl?: string, region?: string) => {
122-
// This command expects two arguments: startUrl and region (both strings).
123-
// If these arguments are provided, they will be used.
124-
// Otherwise, the commands prompts for them interactively.
125-
if (startUrl && region) {
126-
await connectToEnterpriseSso(startUrl, region)
127-
} else {
128-
await getStartUrl()
126+
() =>
127+
async (
128+
startUrl?: string,
129+
region?: string,
130+
customizationArn?: string,
131+
customizationName?: string,
132+
customizationDescription?: string
133+
) => {
134+
// This command supports two sets of arguments:
135+
// * startUrl and region. If both arguments are provided they will be used, otherwise
136+
// the command prompts for them interactively.
137+
// * customization{Arn, Name, Description}. If at least customizationArn is provided,
138+
// the command selects this customization.
139+
if (startUrl && region) {
140+
await connectToEnterpriseSso(startUrl, region)
141+
} else {
142+
await getStartUrl()
143+
}
144+
if (customizationArn) {
145+
const match = getPersistedCustomizations().find(c => c.arn == customizationArn)
146+
const customization = {
147+
arn: customizationArn,
148+
name: customizationName ?? match?.name ?? 'unknown',
149+
description: customizationDescription ?? match?.description ?? 'unknown',
150+
}
151+
await selectCustomization(customization)
152+
}
129153
}
130-
}
131154
)
132155

133156
export const showLearnMore = Commands.declare('aws.codeWhisperer.learnMore', () => async () => {

0 commit comments

Comments
 (0)