@@ -21,6 +21,7 @@ import com.intellij.psi.PsiDocumentManager
2121import com.intellij.psi.PsiFile
2222import com.intellij.util.concurrency.annotations.RequiresEdt
2323import com.intellij.util.messages.Topic
24+ import io.ktor.client.request.request
2425import kotlinx.coroutines.CoroutineScope
2526import kotlinx.coroutines.Deferred
2627import kotlinx.coroutines.Job
@@ -231,7 +232,8 @@ class CodeWhispererService(private val cs: CoroutineScope) : Disposable {
231232 buildCodeWhispererRequest(
232233 requestContext.fileContextInfo,
233234 requestContext.awaitSupplementalContext(),
234- requestContext.customizationArn
235+ requestContext.customizationArn,
236+ requestContext.workspaceId
235237 )
236238 )
237239
@@ -666,7 +668,12 @@ class CodeWhispererService(private val cs: CoroutineScope) : Disposable {
666668 // 5. customization
667669 val customizationArn = CodeWhispererModelConfigurator .getInstance().activeCustomization(project)?.arn
668670
669- return RequestContext (project, editor, triggerTypeInfo, caretPosition, fileContext, supplementalContext, connection, latencyContext, customizationArn)
671+ // TODO: use workspaceID from LSP
672+ // hardcoded for now!
673+ val workspaceId = null
674+
675+ return RequestContext (project, editor, triggerTypeInfo, caretPosition,
676+ fileContext, supplementalContext, connection, latencyContext, customizationArn, workspaceId)
670677 }
671678
672679 fun validateResponse (response : GenerateCompletionsResponse ): GenerateCompletionsResponse {
@@ -800,6 +807,7 @@ class CodeWhispererService(private val cs: CoroutineScope) : Disposable {
800807 fileContextInfo : FileContextInfo ,
801808 supplementalContext : SupplementalContextInfo ? ,
802809 customizationArn : String? ,
810+ workspaceId : String?
803811 ): GenerateCompletionsRequest {
804812 val programmingLanguage = ProgrammingLanguage .builder()
805813 .languageName(fileContextInfo.programmingLanguage.toCodeWhispererRuntimeLanguage().languageId)
@@ -828,6 +836,7 @@ class CodeWhispererService(private val cs: CoroutineScope) : Disposable {
828836 .referenceTrackerConfiguration { it.recommendationsWithReferences(includeCodeWithReference) }
829837 .customizationArn(customizationArn)
830838 .optOutPreference(getTelemetryOptOutPreference())
839+ .workspaceId(workspaceId)
831840 .build()
832841 }
833842 }
@@ -843,6 +852,7 @@ data class RequestContext(
843852 val connection : ToolkitConnection ? ,
844853 val latencyContext : LatencyContext ,
845854 val customizationArn : String? ,
855+ val workspaceId : String?
846856) {
847857 // TODO: should make the entire getRequestContext() suspend function instead of making supplemental context only
848858 var supplementalContext: SupplementalContextInfo ? = null
0 commit comments