Skip to content

Commit d856334

Browse files
committed
feat(amazonq): Add project context to LSP client
1 parent 42636aa commit d856334

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

packages/amazonq/src/lsp/client.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ export async function startLanguageServer(
7979
* Convert VSCode settings format to be compatible with flare's configs
8080
*/
8181
configuration: async (params, token, next) => {
82+
const vscodeConfig = vscode.workspace.getConfiguration()
8283
const config = await next(params, token)
8384
if (params.items[0].section === 'aws.q') {
8485
const customization = undefinedIfEmpty(getSelectedCustomization().arn)
@@ -92,20 +93,20 @@ export async function startLanguageServer(
9293
customization,
9394
optOutTelemetry: getOptOutPreference() === 'OPTOUT',
9495
projectContext: {
95-
enableLocalIndexing: true,
96+
enableLocalIndexing: vscodeConfig.get('amazonQ.workspaceIndex'),
97+
enableGpuAcceleration: vscodeConfig.get('amazonQ.workspaceIndexUseGPU'),
98+
indexWorkerThreads: vscodeConfig.get('amazonQ.workspaceIndexWorkerThreads'),
9699
},
97100
},
98101
]
99102
}
100103
if (params.items[0].section === 'aws.codeWhisperer') {
101104
return [
102105
{
103-
includeSuggestionsWithCodeReferences: vscode.workspace
104-
.getConfiguration()
105-
.get('amazonQ.showCodeWithReferences'),
106-
shareCodeWhispererContentWithAWS: vscode.workspace
107-
.getConfiguration()
108-
.get('amazonQ.shareContentWithAWS'),
106+
includeSuggestionsWithCodeReferences: vscodeConfig.get(
107+
'amazonQ.showCodeWithReferences'
108+
),
109+
shareCodeWhispererContentWithAWS: vscodeConfig.get('amazonQ.shareContentWithAWS'),
109110
},
110111
]
111112
}

0 commit comments

Comments
 (0)