Skip to content

Commit f1d59c2

Browse files
committed
wip
1 parent 2e1a219 commit f1d59c2

File tree

9 files changed

+587
-503
lines changed

9 files changed

+587
-503
lines changed

aws-toolkit-vscode.code-workspace

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
{
1313
"path": "packages/amazonq",
1414
},
15+
{
16+
"path": "../language-servers",
17+
},
1518
],
1619
"settings": {
1720
"typescript.tsdk": "node_modules/typescript/lib",

packages/amazonq/.vscode/launch.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
"args": ["--extensionDevelopmentPath=${workspaceFolder}"],
1414
"env": {
1515
"SSMDOCUMENT_LANGUAGESERVER_PORT": "6010",
16-
"WEBPACK_DEVELOPER_SERVER": "http://localhost:8080"
16+
"WEBPACK_DEVELOPER_SERVER": "http://localhost:8080",
1717
// Below allows for overrides used during development
18-
// "__AMAZONQLSP_PATH": "${workspaceFolder}/../../../language-servers/app/aws-lsp-codewhisperer-runtimes/out/agent-standalone.js",
18+
"__AMAZONQLSP_PATH": "${workspaceFolder}/../../../language-servers/app/aws-lsp-codewhisperer-runtimes/out/agent-standalone.js"
1919
// "__AMAZONQLSP_UI": "${workspaceFolder}/../../../language-servers/chat-client/build/amazonq-ui.js"
2020
},
2121
"envFile": "${workspaceFolder}/.local.env",

packages/amazonq/package.json

Lines changed: 36 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1289,159 +1289,173 @@
12891289
"fontCharacter": "\\f1d2"
12901290
}
12911291
},
1292-
"aws-lambda-function": {
1292+
"aws-lambda-deployed-function": {
12931293
"description": "AWS Contributed Icon",
12941294
"default": {
12951295
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
12961296
"fontCharacter": "\\f1d3"
12971297
}
12981298
},
1299-
"aws-mynah-MynahIconBlack": {
1299+
"aws-lambda-function": {
13001300
"description": "AWS Contributed Icon",
13011301
"default": {
13021302
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
13031303
"fontCharacter": "\\f1d4"
13041304
}
13051305
},
1306-
"aws-mynah-MynahIconWhite": {
1306+
"aws-lambda-invoke-remotely": {
13071307
"description": "AWS Contributed Icon",
13081308
"default": {
13091309
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
13101310
"fontCharacter": "\\f1d5"
13111311
}
13121312
},
1313-
"aws-mynah-logo": {
1313+
"aws-mynah-MynahIconBlack": {
13141314
"description": "AWS Contributed Icon",
13151315
"default": {
13161316
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
13171317
"fontCharacter": "\\f1d6"
13181318
}
13191319
},
1320-
"aws-redshift-cluster": {
1320+
"aws-mynah-MynahIconWhite": {
13211321
"description": "AWS Contributed Icon",
13221322
"default": {
13231323
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
13241324
"fontCharacter": "\\f1d7"
13251325
}
13261326
},
1327-
"aws-redshift-cluster-connected": {
1327+
"aws-mynah-logo": {
13281328
"description": "AWS Contributed Icon",
13291329
"default": {
13301330
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
13311331
"fontCharacter": "\\f1d8"
13321332
}
13331333
},
1334-
"aws-redshift-database": {
1334+
"aws-redshift-cluster": {
13351335
"description": "AWS Contributed Icon",
13361336
"default": {
13371337
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
13381338
"fontCharacter": "\\f1d9"
13391339
}
13401340
},
1341-
"aws-redshift-redshift-cluster-connected": {
1341+
"aws-redshift-cluster-connected": {
13421342
"description": "AWS Contributed Icon",
13431343
"default": {
13441344
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
13451345
"fontCharacter": "\\f1da"
13461346
}
13471347
},
1348-
"aws-redshift-schema": {
1348+
"aws-redshift-database": {
13491349
"description": "AWS Contributed Icon",
13501350
"default": {
13511351
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
13521352
"fontCharacter": "\\f1db"
13531353
}
13541354
},
1355-
"aws-redshift-table": {
1355+
"aws-redshift-redshift-cluster-connected": {
13561356
"description": "AWS Contributed Icon",
13571357
"default": {
13581358
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
13591359
"fontCharacter": "\\f1dc"
13601360
}
13611361
},
1362-
"aws-s3-bucket": {
1362+
"aws-redshift-schema": {
13631363
"description": "AWS Contributed Icon",
13641364
"default": {
13651365
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
13661366
"fontCharacter": "\\f1dd"
13671367
}
13681368
},
1369-
"aws-s3-create-bucket": {
1369+
"aws-redshift-table": {
13701370
"description": "AWS Contributed Icon",
13711371
"default": {
13721372
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
13731373
"fontCharacter": "\\f1de"
13741374
}
13751375
},
1376-
"aws-sagemaker-code-editor": {
1376+
"aws-s3-bucket": {
13771377
"description": "AWS Contributed Icon",
13781378
"default": {
13791379
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
13801380
"fontCharacter": "\\f1df"
13811381
}
13821382
},
1383-
"aws-sagemaker-jupyter-lab": {
1383+
"aws-s3-create-bucket": {
13841384
"description": "AWS Contributed Icon",
13851385
"default": {
13861386
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
13871387
"fontCharacter": "\\f1e0"
13881388
}
13891389
},
1390-
"aws-sagemakerunifiedstudio-catalog": {
1390+
"aws-sagemaker-code-editor": {
13911391
"description": "AWS Contributed Icon",
13921392
"default": {
13931393
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
13941394
"fontCharacter": "\\f1e1"
13951395
}
13961396
},
1397-
"aws-sagemakerunifiedstudio-spaces": {
1397+
"aws-sagemaker-jupyter-lab": {
13981398
"description": "AWS Contributed Icon",
13991399
"default": {
14001400
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
14011401
"fontCharacter": "\\f1e2"
14021402
}
14031403
},
1404-
"aws-sagemakerunifiedstudio-spaces-dark": {
1404+
"aws-sagemakerunifiedstudio-catalog": {
14051405
"description": "AWS Contributed Icon",
14061406
"default": {
14071407
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
14081408
"fontCharacter": "\\f1e3"
14091409
}
14101410
},
1411-
"aws-sagemakerunifiedstudio-symbol-int": {
1411+
"aws-sagemakerunifiedstudio-spaces": {
14121412
"description": "AWS Contributed Icon",
14131413
"default": {
14141414
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
14151415
"fontCharacter": "\\f1e4"
14161416
}
14171417
},
1418-
"aws-sagemakerunifiedstudio-table": {
1418+
"aws-sagemakerunifiedstudio-spaces-dark": {
14191419
"description": "AWS Contributed Icon",
14201420
"default": {
14211421
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
14221422
"fontCharacter": "\\f1e5"
14231423
}
14241424
},
1425-
"aws-schemas-registry": {
1425+
"aws-sagemakerunifiedstudio-symbol-int": {
14261426
"description": "AWS Contributed Icon",
14271427
"default": {
14281428
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
14291429
"fontCharacter": "\\f1e6"
14301430
}
14311431
},
1432-
"aws-schemas-schema": {
1432+
"aws-sagemakerunifiedstudio-table": {
14331433
"description": "AWS Contributed Icon",
14341434
"default": {
14351435
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
14361436
"fontCharacter": "\\f1e7"
14371437
}
14381438
},
1439-
"aws-stepfunctions-preview": {
1439+
"aws-schemas-registry": {
14401440
"description": "AWS Contributed Icon",
14411441
"default": {
14421442
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
14431443
"fontCharacter": "\\f1e8"
14441444
}
1445+
},
1446+
"aws-schemas-schema": {
1447+
"description": "AWS Contributed Icon",
1448+
"default": {
1449+
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
1450+
"fontCharacter": "\\f1e9"
1451+
}
1452+
},
1453+
"aws-stepfunctions-preview": {
1454+
"description": "AWS Contributed Icon",
1455+
"default": {
1456+
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
1457+
"fontCharacter": "\\f1ea"
1458+
}
14451459
}
14461460
},
14471461
"walkthroughs": [

packages/amazonq/src/app/inline/EditRendering/displayImage.ts

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

6-
import { getContext, getLogger, setContext } from 'aws-core-vscode/shared'
6+
import { getLogger, setContext } from 'aws-core-vscode/shared'
77
import * as vscode from 'vscode'
88
import { applyPatch, diffLines } from 'diff'
99
import { LanguageClient } from 'vscode-languageclient'
@@ -311,6 +311,7 @@ export async function displaySvgDecoration(
311311
session: CodeWhispererSession,
312312
languageClient: LanguageClient,
313313
item: InlineCompletionItemWithReferences,
314+
documentChangeListener: vscode.Disposable,
314315
inlineCompletionProvider?: AmazonQInlineCompletionItemProvider
315316
) {
316317
function logSuggestionFailure(type: 'DISCARD' | 'REJECT', reason: string, suggestionContent: string) {
@@ -359,26 +360,7 @@ export async function displaySvgDecoration(
359360
logSuggestionFailure('DISCARD', 'Invalid patch', item.insertText as string)
360361
return
361362
}
362-
const documentChangeListener = vscode.workspace.onDidChangeTextDocument((e) => {
363-
if (e.contentChanges.length <= 0) {
364-
return
365-
}
366-
if (e.document !== editor.document) {
367-
return
368-
}
369-
if (vsCodeState.isCodeWhispererEditing) {
370-
return
371-
}
372-
if (getContext('aws.amazonq.editSuggestionActive') === false) {
373-
return
374-
}
375363

376-
const isPatchValid = applyPatch(e.document.getText(), item.insertText as string)
377-
if (!isPatchValid) {
378-
logSuggestionFailure('REJECT', 'Invalid patch due to document change', item.insertText as string)
379-
void vscode.commands.executeCommand('aws.amazonq.inline.rejectEdit')
380-
}
381-
})
382364
const cursorChangeListener = vscode.window.onDidChangeTextEditorSelection((e) => {
383365
if (!EditSuggestionState.isEditSuggestionActive()) {
384366
return

0 commit comments

Comments
 (0)