-
Notifications
You must be signed in to change notification settings - Fork 68
feat(amazonq): inline unit test generation #1406
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
5/21 |
server/aws-lsp-codewhisperer/src/shared/supplementalContextUtil/unitTestIntentDetection.ts
Outdated
Show resolved
Hide resolved
server/aws-lsp-codewhisperer/src/shared/supplementalContextUtil/unitTestIntentDetection.ts
Outdated
Show resolved
Hide resolved
server/aws-lsp-codewhisperer/src/shared/supplementalContextUtil/unitTestIntentDetection.test.ts
Outdated
Show resolved
Hide resolved
supplementalContextValue = await waitUntil( | ||
async function () { | ||
const focalFile = await utgFocalFileResolver.inferFocalFile(document, workspace) | ||
if (focalFile) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When isUtg
is true but inferFocalFile
fails to identify a focal file, should we fall back to using BM25 to retrieve supplemental context? Currently, the logic seems to return an empty result in this case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will follow up
doesnt work in windows
|
also not work in windows
|
const lastMatch = matches[matches.length - 1] | ||
const lastMatchPos = lastMatch.index! + lastMatch[0].length | ||
const tailFromLastTest = content.slice(lastMatchPos) | ||
const lines = tailFromLastTest.split('\n') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should use either \r?\n
or os.EOL
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nm these are not used at this point. Will consider removing them when we're sure they are 100% not needed anymore
test failure are fixed 8a33f2c |
will take below as followups
|
Problem
UTG is not implemented in Flare and also science team proposed improvement based on the existing UTG living in VSCode/Jetbrains.
Solution
unitTestIntentDetection.ts
is the logic to check provided file and its content is a test file or src file.focalFileResolution.ts
is the logic to resolve the focal file (i.e. src file of the provided test file)License
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.