Skip to content

Commit 6d3bbca

Browse files
committed
Merge branch 'feedback-functionality' of github.com:chungjac/aws-toolkit-vscode into feedback-functionality
2 parents 264bfd9 + 3668f2e commit 6d3bbca

File tree

349 files changed

+1944
-1572
lines changed

Some content is hidden

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

349 files changed

+1944
-1572
lines changed

.eslintrc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ module.exports = {
180180
'aws-toolkits/no-console-log': 'error',
181181
'aws-toolkits/no-json-stringify-in-log': 'error',
182182
'aws-toolkits/no-printf-mismatch': 'error',
183+
'aws-toolkits/no-index-import': 'error',
183184
'no-restricted-imports': [
184185
'error',
185186
{
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": "Amazon Q /test: Truncating user input to 4096 characters for unit test generation."
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": "Amazon Q /test: Q identify active test file and infer source file for test generation."
4+
}

packages/amazonq/.vscode/tasks.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@
4444
"problemMatcher": "$ts-webpack-watch",
4545
"options": {
4646
"cwd": "${workspaceFolder}/../../packages/core"
47-
}
47+
},
48+
"presentation": { "panel": "dedicated" }
4849
},
4950
{
5051
"label": "terminate",

packages/amazonq/test/unit/amazonqFeatureDev/session/session.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ import {
1818
sessionWriteFile,
1919
assertTelemetry,
2020
} from 'aws-core-vscode/test'
21-
import { CurrentWsFolders, CodeGenState, FeatureDevClient, featureDevScheme } from 'aws-core-vscode/amazonqFeatureDev'
22-
import { Messenger } from 'aws-core-vscode/amazonq'
21+
import { FeatureDevClient, featureDevScheme, FeatureDevCodeGenState } from 'aws-core-vscode/amazonqFeatureDev'
22+
import { Messenger, CurrentWsFolders } from 'aws-core-vscode/amazonq'
2323
import path from 'path'
2424
import { fs } from 'aws-core-vscode/shared'
2525

@@ -75,7 +75,7 @@ describe('session', () => {
7575
workspaceFolders,
7676
}
7777

78-
const codeGenState = new CodeGenState(
78+
const codeGenState = new FeatureDevCodeGenState(
7979
testConfig,
8080
[
8181
{

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@
424424
"compileOnly": "tsc -p ./",
425425
"compileDev": "npm run compile -- --mode development",
426426
"webpackDev": "webpack --mode development",
427-
"serveVue": "webpack serve --config-name vue --mode development",
427+
"serveVue": "ts-node ./scripts/build/checkServerPort.ts && webpack serve --port 8080 --config-name vue --mode development",
428428
"watch": "npm run clean && npm run buildScripts && npm run compileOnly -- --watch",
429429
"lint": "ts-node ./scripts/lint/testLint.ts",
430430
"generateClients": "ts-node ./scripts/build/generateServiceClient.ts ",
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
/*!
2+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
/**
7+
* Validate that the required port used by webviews during development is not being used.
8+
*/
9+
10+
import * as net from 'net'
11+
12+
/** This must be kept up to date with the port that is being used to serve the vue files. */
13+
const portNumber = 8080
14+
15+
function checkPort(port: number): Promise<boolean> {
16+
return new Promise((resolve) => {
17+
const server = net.createServer()
18+
19+
server.once('error', (err) => {
20+
if ((err as NodeJS.ErrnoException).code === 'EADDRINUSE') {
21+
resolve(true)
22+
}
23+
})
24+
25+
server.once('listening', () => {
26+
server.close()
27+
resolve(false)
28+
})
29+
30+
server.listen(port)
31+
})
32+
}
33+
34+
async function main() {
35+
try {
36+
const isPortInUse = await checkPort(portNumber)
37+
38+
if (isPortInUse) {
39+
console.error(`
40+
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
41+
42+
ERROR: Webviews will not load as expected, meaning Q may not work.
43+
REASON: Port ${portNumber} is already in use, preventing the latest webview files from being served.
44+
SOLUTION: Kill the current process using port ${portNumber}.
45+
- Unix: "kill -9 $(lsof -t -i :${portNumber})"
46+
47+
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
48+
`)
49+
process.exit(1)
50+
}
51+
} catch (error) {
52+
console.error('Error checking port:', error)
53+
process.exit(1)
54+
}
55+
}
56+
57+
void main()
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/*!
2+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
import { ServiceOptions } from '../../shared/awsClientBuilder'
7+
8+
export abstract class FeatureClient {
9+
public abstract getClient(options?: Partial<ServiceOptions>): Promise<any>
10+
11+
public abstract createConversation(): Promise<string>
12+
13+
public abstract createUploadUrl(
14+
conversationId: string,
15+
contentChecksumSha256: string,
16+
contentLength: number,
17+
uploadId: string
18+
): Promise<any>
19+
20+
public abstract startCodeGeneration(
21+
conversationId: string,
22+
uploadId: string,
23+
message: string,
24+
intent: any,
25+
codeGenerationId: string,
26+
currentCodeGenerationId?: string,
27+
intentContext?: any
28+
): Promise<any>
29+
30+
public abstract getCodeGeneration(conversationId: string, codeGenerationId: string): Promise<any>
31+
32+
public abstract exportResultArchive(conversationId: string): Promise<any>
33+
}

packages/core/src/amazonq/commons/connector/baseMessenger.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
import { ChatItemAction, ProgressField } from '@aws/mynah-ui'
77
import { AuthFollowUpType, AuthMessageDataMap } from '../../../amazonq/auth/model'
8-
import { FeatureAuthState } from '../../../codewhisperer'
98
import { i18n } from '../../../shared/i18n-helper'
109
import { CodeReference } from '../../../amazonq/webview/ui/connector'
1110

@@ -25,9 +24,9 @@ import {
2524
UpdatePlaceholderMessage,
2625
UpdatePromptProgressMessage,
2726
} from './connectorMessages'
28-
import { FollowUpTypes } from '../types'
27+
import { DeletedFileInfo, FollowUpTypes, NewFileInfo } from '../types'
2928
import { messageWithConversationId } from '../../../amazonqFeatureDev/userFacingText'
30-
import { DeletedFileInfo, NewFileInfo } from '../../../amazonqFeatureDev/types'
29+
import { FeatureAuthState } from '../../../codewhisperer/util/authUtil'
3130

3231
export class Messenger {
3332
public constructor(

packages/core/src/amazonq/commons/connector/connectorMessages.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { MessagePublisher } from '../../messages/messagePublisher'
88
import { CodeReference } from '../../webview/ui/connector'
99
import { ChatItemAction, ProgressField, SourceLink } from '@aws/mynah-ui'
1010
import { ChatItemType } from '../model'
11-
import { DeletedFileInfo, NewFileInfo } from '../../../amazonqFeatureDev/types'
11+
import { DeletedFileInfo, NewFileInfo } from '../types'
1212
import { licenseText } from '../../../amazonqFeatureDev/constants'
1313

1414
class UiMessage {

0 commit comments

Comments
 (0)