Skip to content

Commit ce336a3

Browse files
authored
feat(amazonq): workspace indexing only applies to new files that are changed (#5559)
1 parent 7420808 commit ce336a3

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type": "Feature",
3+
"description": "Improve workspace indexing by only index files that are changed since last indexing"
4+
}

packages/core/src/amazonq/lsp/lspClient.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import { LanguageClient, LanguageClientOptions, ServerOptions, TransportKind } f
2020
import { GetUsageRequestType, IndexRequestType, QueryRequestType, UpdateIndexRequestType, Usage } from './types'
2121
import { Writable } from 'stream'
2222
import { CodeWhispererSettings } from '../../codewhisperer/util/codewhispererSettings'
23-
import { getLogger } from '../../shared'
23+
import { fs, getLogger } from '../../shared'
2424

2525
const localize = nls.loadMessageBundle()
2626

@@ -172,7 +172,8 @@ export async function activate(extensionContext: ExtensionContext) {
172172
initializationOptions: {
173173
handledSchemaProtocols: ['file', 'untitled'], // language server only loads file-URI. Fetching schemas with other protocols ('http'...) are made on the client.
174174
provideFormatter: false, // tell the server to not provide formatting capability and ignore the `aws.stepfunctions.asl.format.enable` setting.
175-
extensionPath: extensionContext.extensionPath,
175+
// this is used by LSP to determine index cache path, move to this folder so that when extension updates index is not deleted.
176+
extensionPath: path.join(fs.getUserHomeDir(), '.aws', 'amazonq', 'cache'),
176177
},
177178
}
178179

packages/core/src/amazonq/lsp/lspController.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export interface Manifest {
6767
}
6868
const manifestUrl = 'https://aws-toolkit-language-servers.amazonaws.com/q-context/manifest.json'
6969
// this LSP client in Q extension is only going to work with these LSP server versions
70-
const supportedLspServerVersions = ['0.1.5']
70+
const supportedLspServerVersions = ['0.1.6']
7171

7272
const nodeBinName = process.platform === 'win32' ? 'node.exe' : 'node'
7373
/*

0 commit comments

Comments
 (0)