Skip to content

Conversation

@Will-ShaoHua
Copy link
Contributor

@Will-ShaoHua Will-ShaoHua commented Oct 21, 2024

cherry pick from #4976

  • remove repeated code
  • make message toward lsp type safe
  • add test coverage

Description

License

I confirm that my contribution is made under the terms of the Apache 2.0 license.

@Will-ShaoHua Will-ShaoHua requested review from a team as code owners October 21, 2024 08:34
Comment on lines -56 to -60
data class IndexRequestPayload(
val filePaths: List<String>,
val projectRoot: String,
val refresh: Boolean,
)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines -67 to -73
data class QueryRequestPayload(
val query: String,
)

data class UpdateIndexRequestPayload(
val filePath: String,
)
Copy link
Contributor Author

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 = """
Copy link
Contributor

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

Suggested change
val validQueryChatResponse = """
// language=JSON
val validQueryChatResponse = """

Copy link
Contributor Author

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

Copy link
Contributor Author

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

}

fun updateIndex(filePath: String) {
if (!isIndexComplete.get()) return
Copy link
Contributor Author

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

regression. Please fix ASAP

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ack,updated

@leigaol leigaol enabled auto-merge (squash) October 21, 2024 19:22
@leigaol leigaol merged commit e9bfb9a into aws:main Oct 21, 2024
12 of 13 checks passed
@Will-ShaoHua Will-ShaoHua deleted the lsp-refactor branch October 21, 2024 19:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants