-
Notifications
You must be signed in to change notification settings - Fork 274
config(amazonq): Add project context to inline completion #4976
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
Merged
Merged
Changes from 5 commits
Commits
Show all changes
45 commits
Select commit
Hold shift + click to select a range
fbdd4d3
add inline completion project context call and refactor projectContex…
Will-ShaoHua b150cb8
projectContextController & abtest
Will-ShaoHua eaf4932
tst
Will-ShaoHua 13f2f94
patch
Will-ShaoHua 8577d78
add commented code
Will-ShaoHua 43d698f
patch projectContextEditorListener not updating index
Will-ShaoHua 0655f48
isBlank -> isNotBlank
Will-ShaoHua 1ff4021
Merge remote-tracking branch 'upstream/main' into lsp-client
Will-ShaoHua a59204c
lint
Will-ShaoHua 3840926
timeout LSP query inline for 50ms
Will-ShaoHua 99c3437
dedupe repeated code
Will-ShaoHua fe86a2c
refactor ProjectContextProvider and add tests
Will-ShaoHua b642283
add more test
Will-ShaoHua 7b5ea32
lint
Will-ShaoHua b684c01
Merge branch 'lsp-refactor' into lsp-client-backup
Will-ShaoHua 1e2b21a
add test for queryInline
Will-ShaoHua 3729d98
lint
Will-ShaoHua e45078e
Merge branch 'lsp-client' into lsp-client-backup
Will-ShaoHua 47e3190
lint
Will-ShaoHua 5f3ea1a
Merge remote-tracking branch 'upstream/main' into lsp-client
Will-ShaoHua 1628d33
lint
Will-ShaoHua 2249c8a
add test and fix broken test due to merge
Will-ShaoHua 22acbf8
Merge remote-tracking branch 'upstream/main' into lsp-client
Will-ShaoHua cf4c29c
log
Will-ShaoHua 149e6af
Merge remote-tracking branch 'upstream/main' into lsp-client
Will-ShaoHua 9844c03
do index regardless isProjectContext is on/off
Will-ShaoHua 5ab3d11
Merge remote-tracking branch 'upstream/main' into lsp-client
Will-ShaoHua 71451b9
calc openTabsContext & projectContext concurrently and patch #4978
Will-ShaoHua d7d65d5
lint
Will-ShaoHua 87f4f2c
Merge remote-tracking branch 'upstream/main' into lsp-client
Will-ShaoHua 4663e48
test
Will-ShaoHua 626079d
test
Will-ShaoHua 64cd531
patch
Will-ShaoHua 4b461c1
lint
Will-ShaoHua b1936f7
Merge remote-tracking branch 'upstream/main' into lsp-client
Will-ShaoHua f911b3d
move IndexUpdateMode to lspMessage
Will-ShaoHua 91ae00e
move InlineBm25Chunk to LspMessage.kt
Will-ShaoHua 9e79e54
don't try init encodeerserver in test env
Will-ShaoHua 13e04d2
patch don't try init encodeerserver in test env
Will-ShaoHua 4da830b
restructure concurrency and use suspend func
Will-ShaoHua ff27d01
Merge branch 'lsp-client-suspend-version' into lsp-client
Will-ShaoHua 1966408
lsp version bump
Will-ShaoHua 3c39f90
Merge remote-tracking branch 'upstream/main' into lsp-client
Will-ShaoHua 7c7d58b
changelog
Will-ShaoHua 9f097d7
Merge branch 'main' into lsp-client
rli File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
...rc/software/aws/toolkits/jetbrains/services/cwc/editor/context/project/InlineBm25Chunk.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| // Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| package software.aws.toolkits.jetbrains.services.cwc.editor.context.project | ||
|
|
||
| data class InlineBm25Chunk( | ||
| val content: String, | ||
| val filePath: String, | ||
| val score: Double, | ||
| ) |
60 changes: 60 additions & 0 deletions
60
...ity/src/software/aws/toolkits/jetbrains/services/cwc/editor/context/project/LspMessage.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| // Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| package software.aws.toolkits.jetbrains.services.cwc.editor.context.project | ||
|
|
||
| sealed interface LspMessage { | ||
| val endpoint: String | ||
|
|
||
| data object Initialize : LspMessage { | ||
| override val endpoint: String = "initialize" | ||
| } | ||
|
|
||
| data object Index : LspMessage { | ||
| override val endpoint: String = "buildIndex" | ||
| } | ||
|
|
||
| data object UpdateIndex : LspMessage { | ||
| override val endpoint: String = "updateIndexV2" | ||
| } | ||
|
|
||
| data object QueryChat : LspMessage { | ||
| override val endpoint: String = "query" | ||
| } | ||
|
|
||
| data object QueryInlineCompletion : LspMessage { | ||
| override val endpoint: String = "queryInlineProjectContext" | ||
| } | ||
|
|
||
| data object GetUsageMetrics : LspMessage { | ||
| override val endpoint: String = "getUsage" | ||
| } | ||
| } | ||
|
|
||
| interface LspRequest | ||
|
|
||
| data class IndexRequest( | ||
| val filePaths: List<String>, | ||
| val projectRoot: String, | ||
| val config: String, | ||
| val language: String = "", | ||
| ) : LspRequest | ||
|
|
||
| data class UpdateIndexRequest( | ||
| val filePaths: List<String>, | ||
| val mode: String, | ||
| ) : LspRequest | ||
|
|
||
| data class QueryChatRequest( | ||
| val query: String, | ||
| ) : LspRequest | ||
|
|
||
| data class QueryInlineCompletionRequest( | ||
| val query: String, | ||
| val filePath: String, | ||
| ) : LspRequest | ||
|
|
||
| data class LspResponse( | ||
| val responseCode: Int, | ||
| val responseBody: String, | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.