-
Notifications
You must be signed in to change notification settings - Fork 274
refactor(amazonq) refactor ProjectContextProvider.kt and add tests #4988
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
| data class IndexRequestPayload( | ||
| val filePaths: List<String>, | ||
| val projectRoot: String, | ||
| val refresh: Boolean, | ||
| ) |
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.
| data class QueryRequestPayload( | ||
| val query: String, | ||
| ) | ||
|
|
||
| data class UpdateIndexRequestPayload( | ||
| val filePath: String, | ||
| ) |
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.
| private fun createMockServer() = WireMockRule(wireMockConfig().dynamicPort()) | ||
| } | ||
|
|
||
| val validQueryChatResponse = """ |
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.
can you reformat the JSON blobs
| val validQueryChatResponse = """ | |
| // language=JSON | |
| val validQueryChatResponse = """ |
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.
@rli what does // language=JSON mean here
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.
isee, it tells IDE to treat it as JSON instead plain string
...unity/src/software/aws/toolkits/jetbrains/services/amazonq/project/ProjectContextProvider.kt
Show resolved
Hide resolved
| } | ||
|
|
||
| fun updateIndex(filePath: String) { | ||
| if (!isIndexComplete.get()) return |
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 remove this line.
|
|
||
| fun index(): Boolean { | ||
| logger.info { "project context: indexing ${project.name} on port ${encoderServer.port}" } | ||
| val projectRoot = project.guessProjectDir()?.path ?: return false |
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.
regression. Please fix ASAP
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.
ack,updated
cherry pick from #4976
Description
License
I confirm that my contribution is made under the terms of the Apache 2.0 license.