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
20 changes: 19 additions & 1 deletion packages/amazonq/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,25 @@
"amazonQ.workspaceIndexMaxSize": {
"type": "number",
"markdownDescription": "%AWS.configuration.description.amazonq.workspaceIndexMaxSize%",
"default": 250,
"default": 2048,
"scope": "application"
},
"amazonQ.workspaceIndexMaxFileSize": {
"type": "number",
"markdownDescription": "%AWS.configuration.description.amazonq.workspaceIndexMaxFileSize%",
"default": 10,
"scope": "application"
},
"amazonQ.workspaceIndexCacheDirPath": {
"type": "string",
"markdownDescription": "%AWS.configuration.description.amazonq.workspaceIndexCacheDirPath%",
"default": null,
"scope": "application"
},
"amazonQ.workspaceIndexIgnoreFilePatterns": {
"type": "array",
"markdownDescription": "%AWS.configuration.description.amazonq.workspaceIndexIgnoreFilePatterns%",
"default": [],
"scope": "application"
},
"amazonQ.ignoredSecurityIssues": {
Expand Down
21 changes: 13 additions & 8 deletions packages/amazonq/src/lsp/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {
updateConfigurationRequestType,
WorkspaceFolder,
} from '@aws/language-server-runtimes/protocol'
import { AuthUtil, getSelectedCustomization } from 'aws-core-vscode/codewhisperer'
import { AuthUtil, CodeWhispererSettings, getSelectedCustomization } from 'aws-core-vscode/codewhisperer'
import {
Settings,
oidcClientName,
Expand Down Expand Up @@ -92,20 +92,25 @@ export async function startLanguageServer(
customization,
optOutTelemetry: getOptOutPreference() === 'OPTOUT',
projectContext: {
enableLocalIndexing: true,
enableLocalIndexing: CodeWhispererSettings.instance.isLocalIndexEnabled(),
enableGpuAcceleration: CodeWhispererSettings.instance.isLocalIndexGPUEnabled(),
indexWorkerThreads: CodeWhispererSettings.instance.getIndexWorkerThreads(),
localIndexing: {
ignoreFilePatterns: CodeWhispererSettings.instance.getIndexIgnoreFilePatterns(),
maxFileSizeMB: CodeWhispererSettings.instance.getMaxIndexFileSize(),
maxIndexSizeMB: CodeWhispererSettings.instance.getMaxIndexSize(),
indexCacheDirPath: CodeWhispererSettings.instance.getIndexCacheDirPath(),
},
},
},
]
}
if (params.items[0].section === 'aws.codeWhisperer') {
return [
{
includeSuggestionsWithCodeReferences: vscode.workspace
.getConfiguration()
.get('amazonQ.showCodeWithReferences'),
shareCodeWhispererContentWithAWS: vscode.workspace
.getConfiguration()
.get('amazonQ.shareContentWithAWS'),
includeSuggestionsWithCodeReferences:
CodeWhispererSettings.instance.isSuggestionsWithCodeReferencesEnabled(),
shareCodeWhispererContentWithAWS: !CodeWhispererSettings.instance.isOptoutEnabled(),
},
]
}
Expand Down
5 changes: 4 additions & 1 deletion packages/core/package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,10 @@
"AWS.configuration.description.amazonq.workspaceIndex": "When you add @workspace to your question 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 in 'Local Workspace Index Threads'.",
"AWS.configuration.description.amazonq.workspaceIndexWorkerThreads": "Number of worker threads of Amazon Q local index process. '0' will use the system default worker threads for balance performance. You may increase this number to more quickly index your workspace, but only up to your hardware's number of CPU cores. Please restart VS Code or reload the VS Code window after changing worker threads.",
"AWS.configuration.description.amazonq.workspaceIndexUseGPU": "Enable GPU to help index your local workspace files. Only applies to Linux and Windows.",
"AWS.configuration.description.amazonq.workspaceIndexMaxSize": "The maximum size of local workspace files to be indexed in MB",
"AWS.configuration.description.amazonq.workspaceIndexMaxSize": "The maximum size of local workspace to be indexed in MB",
"AWS.configuration.description.amazonq.workspaceIndexMaxFileSize": "The maximum size of local workspace files to be indexed in MB",
"AWS.configuration.description.amazonq.workspaceIndexIgnoreFilePatterns": "File patterns to ignore when indexing your workspace files",
"AWS.configuration.description.amazonq.workspaceIndexCacheDirPath": "The path to the directory that contains the cache of the index of your workspace files",
"AWS.configuration.description.amazonq.ignoredSecurityIssues": "Specifies a list of code issue identifiers that Amazon Q should ignore when reviewing your workspace. Each item in the array should be a unique string identifier for a specific code issue. This allows you to suppress notifications for known issues that you've assessed and determined to be false positives or not applicable to your project. Use this setting with caution, as it may cause you to miss important security alerts.",
"AWS.command.apig.copyUrl": "Copy URL",
"AWS.command.apig.invokeRemoteRestApi": "Invoke in the cloud",
Expand Down
18 changes: 17 additions & 1 deletion packages/core/src/codewhisperer/util/codewhispererSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ const description = {
workspaceIndexWorkerThreads: Number,
workspaceIndexUseGPU: Boolean,
workspaceIndexMaxSize: Number,
workspaceIndexMaxFileSize: Number,
workspaceIndexCacheDirPath: String,
workspaceIndexIgnoreFilePatterns: ArrayConstructor(String),
allowFeatureDevelopmentToRunCodeAndTests: Object,
ignoredSecurityIssues: ArrayConstructor(String),
}
Expand Down Expand Up @@ -55,7 +58,20 @@ export class CodeWhispererSettings extends fromExtensionManifest('amazonQ', desc

public getMaxIndexSize(): number {
// minimal 1MB
return Math.max(this.get('workspaceIndexMaxSize', 250), 1)
return Math.max(this.get('workspaceIndexMaxSize', 2048), 1)
}

public getMaxIndexFileSize(): number {
// minimal 1MB
return Math.max(this.get('workspaceIndexMaxFileSize', 10), 1)
}

public getIndexCacheDirPath(): string {
return this.get('workspaceIndexCacheDirPath', undefined)
}

public getIndexIgnoreFilePatterns(): string[] {
return this.get('workspaceIndexIgnoreFilePatterns', [])
}

public getAutoBuildSetting(): { [key: string]: boolean } {
Expand Down
3 changes: 3 additions & 0 deletions packages/core/src/shared/settings-amazonq.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ export const amazonqSettings = {
"amazonQ.workspaceIndexWorkerThreads": {},
"amazonQ.workspaceIndexUseGPU": {},
"amazonQ.workspaceIndexMaxSize": {},
"amazonQ.workspaceIndexMaxFileSize": {},
"amazonQ.workspaceIndexCacheDirPath": {},
"amazonQ.workspaceIndexIgnoreFilePatterns": {},
"amazonQ.ignoredSecurityIssues": {}
}

Expand Down
Loading