Skip to content
Open
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 @@ -198,6 +198,20 @@ class CodeWhispererConfigurable(private val project: Project) :
}.comment(message("aws.settings.codewhisperer.project_context.tooltip"))
}

row(message("aws.settings.codewhisperer.project_context_cache_dir")) {
val fileChooserDescriptor = FileChooserDescriptorFactory.createSingleFolderDescriptor()
fileChooserDescriptor.isForcedToUseIdeaFileChooser = true

textFieldWithBrowseButton(fileChooserDescriptor = fileChooserDescriptor)
.bindText(
{ codeWhispererSettings.getProjectContextCacheDir() },
{ codeWhispererSettings.setProjectContextCacheDir(it) }
)
.resizableColumn()
.align(Align.FILL)
.comment(message("aws.settings.codewhisperer.project_context_cache_dir.tooltip"))
}

row(message("aws.settings.codewhisperer.project_context_index_thread")) {
intTextField(
range = CodeWhispererSettings.CONTEXT_INDEX_THREADS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,8 @@ class AmazonQLanguageClientImpl(private val project: Project) : AmazonQLanguageC
indexWorkerThreads = qSettings.getProjectContextIndexThreadCount(),
enableGpuAcceleration = qSettings.isProjectContextGpu(),
localIndexing = LocalIndexingConfiguration(
maxIndexSizeMB = qSettings.getProjectContextIndexMaxSize()
maxIndexSizeMB = qSettings.getProjectContextIndexMaxSize(),
indexCacheDirPath = qSettings.getProjectContextCacheDir()
)
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,15 @@ class CodeWhispererSettings : PersistentStateComponent<CodeWhispererConfiguratio
state.value[CodeWhispererConfigurationType.IsProjectContextGpu] = value
}

fun getProjectContextCacheDir(): String = state.stringValue.getOrDefault(
CodeWhispererStringConfigurationType.ProjectContextCacheDir,
""
)

fun setProjectContextCacheDir(value: String) {
state.stringValue[CodeWhispererStringConfigurationType.ProjectContextCacheDir] = value
}

fun getProjectContextIndexThreadCount(): Int = state.intValue.getOrDefault(
CodeWhispererIntConfigurationType.ProjectContextIndexThreadCount,
0
Expand Down Expand Up @@ -196,6 +205,7 @@ enum class CodeWhispererConfigurationType {

enum class CodeWhispererStringConfigurationType {
IgnoredCodeReviewIssues,
ProjectContextCacheDir,
}

enum class CodeWhispererIntConfigurationType {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,8 @@ aws.settings.codewhisperer.include_code_with_reference=Include suggestions with
aws.settings.codewhisperer.include_code_with_reference.tooltip=When checked, Amazon Q will include suggestions with code references. If you authenticate through IAM Identity Center, this setting is controlled by your Amazon Q Developer Pro administrator. <a href="https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/code-reference.html">Learn more<a/>
aws.settings.codewhisperer.project_context=Workspace index
aws.settings.codewhisperer.project_context.tooltip=When you add @workspace to your questions in Amazon Q chat, Amazon Q will index your workspace files locally to use as context for its response. Extra CPU usage is expected while indexing a workspace. This will not impact Amazon Q features or your IDE, but you may manage CPU usage by setting the number of local threads below.
aws.settings.codewhisperer.project_context_cache_dir=Workspace Index Cache Dir Path
aws.settings.codewhisperer.project_context_cache_dir.tooltip=The path to the directory that contains the cache of the index of your workspace files
aws.settings.codewhisperer.project_context_gpu=Workspace index uses GPU
aws.settings.codewhisperer.project_context_gpu.tooltip=Enable GPU to help index your local workspace files. This setting only applies to Linux and Windows.
aws.settings.codewhisperer.project_context_index_max_size=Workspace index max size
Expand Down
Loading