Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,11 @@ import kotlinx.coroutines.Job
import kotlinx.coroutines.future.await
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
import org.eclipse.lsp4j.DidChangeTextDocumentParams
import org.eclipse.lsp4j.Position
import org.eclipse.lsp4j.TextDocumentContentChangeEvent
import org.eclipse.lsp4j.TextDocumentIdentifier
import org.eclipse.lsp4j.VersionedTextDocumentIdentifier
import org.eclipse.lsp4j.jsonrpc.JsonRpcException
import org.eclipse.lsp4j.jsonrpc.messages.Either
import software.amazon.awssdk.core.exception.SdkServiceException
Expand Down Expand Up @@ -520,6 +523,24 @@ class CodeWhispererService(private val cs: CoroutineScope) : Disposable {
else -> InlineCompletionTriggerKind.Invoke
}
),
documentChangeParams =
if (triggerTypeInfo.automatedTriggerType == CodeWhispererAutomatedTriggerType.IntelliSense()) {
DidChangeTextDocumentParams(
VersionedTextDocumentIdentifier(),
listOf(
TextDocumentContentChangeEvent(
null,
CodeWhispererAutomatedTriggerType.IntelliSense().toString()
)
),
)
} else {
null
},
openTabFilepaths = editor.project?.let { project ->
com.intellij.openapi.fileEditor.FileEditorManager.getInstance(project)
.openFiles.mapNotNull { toUriString(it) }
}.orEmpty(),
).apply {
textDocument = TextDocumentIdentifier(toUriString(editor.virtualFile))
position = Position(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -569,6 +569,8 @@ class CodeWhispererServiceNew(private val cs: CoroutineScope) : Disposable {
else -> InlineCompletionTriggerKind.Invoke
}
),
documentChangeParams = null,
openTabFilepaths = null,
).apply {
textDocument = TextDocumentIdentifier(toUriString(editor.virtualFile))
position = Position(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@

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

import org.eclipse.lsp4j.DidChangeTextDocumentParams
import org.eclipse.lsp4j.TextDocumentPositionAndWorkDoneProgressAndPartialResultParams

data class InlineCompletionWithReferencesParams(
var context: InlineCompletionContext,
var documentChangeParams: DidChangeTextDocumentParams?,
var openTabFilepaths: List<String>?,
) : TextDocumentPositionAndWorkDoneProgressAndPartialResultParams()
Loading