Skip to content

Commit 59e9f9c

Browse files
committed
merge in master
2 parents 3bbabd1 + bdb0a83 commit 59e9f9c

37 files changed

+1750
-321
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"type": "Bug Fix",
3-
"description": "CodeWhisperer: Bug resulting failure of enhanced file context fetching"
4-
}
3+
"description": "CodeWhisperer: issue with fetching enhanced file context"
4+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type": "Bug Fix",
3+
"description": "User setting for \"Share CodeWhisperer Content With AWS\" was not reflected in workspace-level settings"
4+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type": "Feature",
3+
"description": "CodeWhisperer: Improve Java suggestion quality with enhanced file context fetching"
4+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type": "Feature",
3+
"description": "Lambda \"Download\" action now expects \".mjs\" extension for Node18+ lambdas"
4+
}

.github/workflows/node.js.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ jobs:
1414
name: test macOS
1515
runs-on: macos-latest
1616
strategy:
17+
fail-fast: false
1718
matrix:
1819
node-version: [16.x]
1920
vscode-version: [minimum, stable, insiders]

package-lock.json

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

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,8 @@
251251
"aws.codeWhisperer.shareCodeWhispererContentWithAWS": {
252252
"type": "boolean",
253253
"markdownDescription": "%AWS.configuration.description.codewhisperer.shareCodeWhispererContentWithAWS%",
254-
"default": true
254+
"default": true,
255+
"scope": "application"
255256
},
256257
"aws.codeWhisperer.javaCompilationOutput": {
257258
"type": "string",
@@ -3501,7 +3502,7 @@
35013502
"@types/uuid": "^9.0.1",
35023503
"@types/vscode": "^1.65.0",
35033504
"@types/vscode-webview": "^1.57.1",
3504-
"@types/xml2js": "^0.4.8",
3505+
"@types/xml2js": "^0.4.11",
35053506
"@typescript-eslint/eslint-plugin": "^5.59.0",
35063507
"@typescript-eslint/parser": "^5.59.1",
35073508
"@vscode/codicons": "^0.0.33",
@@ -3516,7 +3517,7 @@
35163517
"eslint-plugin-no-null": "^1.0.2",
35173518
"glob": "^7.1.7",
35183519
"husky": "^7.0.2",
3519-
"json-schema-to-typescript": "^12.0.0",
3520+
"json-schema-to-typescript": "^13.0.2",
35203521
"marked": "^5.0.4",
35213522
"mocha": "^10.1.0",
35223523
"mocha-junit-reporter": "^2.2.0",

resources/ec2_connect

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# Usage:
44
# When connecting to a dev environment
5-
# AWS_REGION=… AWS_SSM_CLI=… CODECATALYST_ENDPOINT=… BEARER_TOKEN_LOCATION=… SPACE_NAME=… PROJECT_NAME=… DEVENV_ID=… ./codecatalyst_connect
5+
# AWS_REGION=… AWS_SSM_CLI=… STREAM_URL=… TOKEN=… LOG_FILE_LOCATION==… ./ec2_connect
66

77
set -e
88
set -u

src/codecatalyst/activation.ts

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,17 @@ import { CodeCatalystCommands } from './commands'
1212
import { GitExtension } from '../shared/extensions/git'
1313
import { CodeCatalystAuthenticationProvider } from './auth'
1414
import { registerDevfileWatcher } from './devfile'
15-
import { DevEnvClient } from '../shared/clients/devenvClient'
15+
import { DevEnvClient, DevEnvActivity } from '../shared/clients/devenvClient'
1616
import { watchRestartingDevEnvs } from './reconnect'
1717
import { PromptSettings } from '../shared/settings'
1818
import { dontShow } from '../shared/localizedText'
1919
import { getIdeProperties, isCloud9 } from '../shared/extensionUtilities'
2020
import { Commands } from '../shared/vscode/commands2'
2121
import { getCodeCatalystConfig } from '../shared/clients/codecatalystClient'
22-
import { getThisDevEnv } from './model'
2322
import { isDevenvVscode } from './utils'
23+
import { getThisDevEnv } from './model'
2424
import { getLogger } from '../shared/logger/logger'
25+
import { InactivityMessage, shouldTrackUserActivity } from './devEnv'
2526

2627
const localize = nls.loadMessageBundle()
2728

@@ -38,6 +39,10 @@ export async function activate(ctx: ExtContext): Promise<void> {
3839
...Object.values(CodeCatalystCommands.declared).map(c => c.register(commands))
3940
)
4041

42+
Commands.register('aws.codecatalyst.removeConnection', () => {
43+
authProvider.removeSavedConnection()
44+
})
45+
4146
if (!isCloud9()) {
4247
GitExtension.instance.registerRemoteSourceProvider(remoteSourceProvider).then(disposable => {
4348
ctx.extensionContext.subscriptions.push(disposable)
@@ -56,11 +61,6 @@ export async function activate(ctx: ExtContext): Promise<void> {
5661
watchRestartingDevEnvs(ctx, authProvider)
5762
}
5863

59-
ctx.extensionContext.subscriptions.push(DevEnvClient.instance)
60-
if (DevEnvClient.instance.id) {
61-
ctx.extensionContext.subscriptions.push(registerDevfileWatcher(DevEnvClient.instance))
62-
}
63-
6464
const thisDevenv = (await getThisDevEnv(authProvider))?.unwrapOrElse(err => {
6565
getLogger().warn('codecatalyst: failed to get current Dev Enviroment: %s', err)
6666
return undefined
@@ -69,6 +69,11 @@ export async function activate(ctx: ExtContext): Promise<void> {
6969
if (!thisDevenv) {
7070
getLogger().verbose('codecatalyst: not a devenv, getThisDevEnv() returned empty')
7171
} else {
72+
ctx.extensionContext.subscriptions.push(DevEnvClient.instance)
73+
if (DevEnvClient.instance.id) {
74+
ctx.extensionContext.subscriptions.push(registerDevfileWatcher(DevEnvClient.instance))
75+
}
76+
7277
getLogger().info('codecatalyst: Dev Environment ides=%O', thisDevenv?.summary.ides)
7378
if (!isCloud9() && thisDevenv && !isDevenvVscode(thisDevenv.summary.ides)) {
7479
// Prevent Toolkit from reconnecting to a "non-vscode" devenv by actively closing it.
@@ -95,11 +100,17 @@ export async function activate(ctx: ExtContext): Promise<void> {
95100
}
96101
})
97102
}
98-
}
99103

100-
Commands.register('aws.codecatalyst.removeConnection', () => {
101-
authProvider.removeSavedConnection()
102-
})
104+
const maxInactivityMinutes = thisDevenv.summary.inactivityTimeoutMinutes
105+
const devEnvClient = thisDevenv.devenvClient
106+
const devEnvActivity = await DevEnvActivity.instanceIfActivityTrackingEnabled(devEnvClient)
107+
if (shouldTrackUserActivity(maxInactivityMinutes) && devEnvActivity) {
108+
const inactivityMessage = new InactivityMessage()
109+
inactivityMessage.setupMessage(maxInactivityMinutes, devEnvActivity)
110+
111+
ctx.extensionContext.subscriptions.push(inactivityMessage, devEnvActivity)
112+
}
113+
}
103114
}
104115

105116
async function showReadmeFileOnFirstLoad(workspaceState: vscode.ExtensionContext['workspaceState']): Promise<void> {

0 commit comments

Comments
 (0)