Skip to content

Commit 84c19c2

Browse files
Merge main into feature/remote-chat-lsp
2 parents aefd8f3 + f221c06 commit 84c19c2

File tree

3 files changed

+26
-0
lines changed

3 files changed

+26
-0
lines changed

plugins/amazonq/codewhisperer/jetbrains-community/src/software/aws/toolkits/jetbrains/services/codewhisperer/service/CodeWhispererService.kt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,11 @@ import kotlinx.coroutines.Job
2424
import kotlinx.coroutines.future.await
2525
import kotlinx.coroutines.launch
2626
import kotlinx.coroutines.withContext
27+
import org.eclipse.lsp4j.DidChangeTextDocumentParams
2728
import org.eclipse.lsp4j.Position
29+
import org.eclipse.lsp4j.TextDocumentContentChangeEvent
2830
import org.eclipse.lsp4j.TextDocumentIdentifier
31+
import org.eclipse.lsp4j.VersionedTextDocumentIdentifier
2932
import org.eclipse.lsp4j.jsonrpc.JsonRpcException
3033
import org.eclipse.lsp4j.jsonrpc.messages.Either
3134
import software.amazon.awssdk.core.exception.SdkServiceException
@@ -520,6 +523,24 @@ class CodeWhispererService(private val cs: CoroutineScope) : Disposable {
520523
else -> InlineCompletionTriggerKind.Invoke
521524
}
522525
),
526+
documentChangeParams =
527+
if (triggerTypeInfo.automatedTriggerType == CodeWhispererAutomatedTriggerType.IntelliSense()) {
528+
DidChangeTextDocumentParams(
529+
VersionedTextDocumentIdentifier(),
530+
listOf(
531+
TextDocumentContentChangeEvent(
532+
null,
533+
CodeWhispererAutomatedTriggerType.IntelliSense().toString()
534+
)
535+
),
536+
)
537+
} else {
538+
null
539+
},
540+
openTabFilepaths = editor.project?.let { project ->
541+
com.intellij.openapi.fileEditor.FileEditorManager.getInstance(project)
542+
.openFiles.mapNotNull { toUriString(it) }
543+
}.orEmpty(),
523544
).apply {
524545
textDocument = TextDocumentIdentifier(toUriString(editor.virtualFile))
525546
position = Position(

plugins/amazonq/codewhisperer/jetbrains-community/src/software/aws/toolkits/jetbrains/services/codewhisperer/service/CodeWhispererServiceNew.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -569,6 +569,8 @@ class CodeWhispererServiceNew(private val cs: CoroutineScope) : Disposable {
569569
else -> InlineCompletionTriggerKind.Invoke
570570
}
571571
),
572+
documentChangeParams = null,
573+
openTabFilepaths = null,
572574
).apply {
573575
textDocument = TextDocumentIdentifier(toUriString(editor.virtualFile))
574576
position = Position(

plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/lsp/model/aws/textDocument/InlineCompletionWithReferencesParams.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,11 @@
33

44
package software.aws.toolkits.jetbrains.services.amazonq.lsp.model.aws.textDocument
55

6+
import org.eclipse.lsp4j.DidChangeTextDocumentParams
67
import org.eclipse.lsp4j.TextDocumentPositionAndWorkDoneProgressAndPartialResultParams
78

89
data class InlineCompletionWithReferencesParams(
910
var context: InlineCompletionContext,
11+
var documentChangeParams: DidChangeTextDocumentParams?,
12+
var openTabFilepaths: List<String>?,
1013
) : TextDocumentPositionAndWorkDoneProgressAndPartialResultParams()

0 commit comments

Comments
 (0)