Skip to content

Commit d0abaad

Browse files
authored
fix: adding files on windows properly triggers reindexing (#1755)
1 parent a9eb908 commit d0abaad

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

server/aws-lsp-codewhisperer/src/language-server/localProjectContext/localProjectContextServer.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ export const LocalProjectContextServer =
8080

8181
lsp.workspace.onDidCreateFiles(async event => {
8282
try {
83-
const filePaths = event.files.map(file => URI.parse(file.uri).fsPath)
83+
const filePaths = event.files.map(file => URI.file(file.uri).fsPath)
8484
await localProjectContextController.updateIndexAndContextCommand(filePaths, true)
8585
} catch (error) {
8686
logging.error(`Error handling create event: ${error}`)
@@ -89,7 +89,7 @@ export const LocalProjectContextServer =
8989

9090
lsp.workspace.onDidDeleteFiles(async event => {
9191
try {
92-
const filePaths = event.files.map(file => URI.parse(file.uri).fsPath)
92+
const filePaths = event.files.map(file => URI.file(file.uri).fsPath)
9393
await localProjectContextController.updateIndexAndContextCommand(filePaths, false)
9494
} catch (error) {
9595
logging.error(`Error handling delete event: ${error}`)
@@ -98,8 +98,8 @@ export const LocalProjectContextServer =
9898

9999
lsp.workspace.onDidRenameFiles(async event => {
100100
try {
101-
const oldPaths = event.files.map(file => URI.parse(file.oldUri).fsPath)
102-
const newPaths = event.files.map(file => URI.parse(file.newUri).fsPath)
101+
const oldPaths = event.files.map(file => URI.file(file.oldUri).fsPath)
102+
const newPaths = event.files.map(file => URI.file(file.newUri).fsPath)
103103

104104
await localProjectContextController.updateIndexAndContextCommand(oldPaths, false)
105105
await localProjectContextController.updateIndexAndContextCommand(newPaths, true)
@@ -110,7 +110,7 @@ export const LocalProjectContextServer =
110110

111111
lsp.onDidSaveTextDocument(async event => {
112112
try {
113-
const filePaths = [URI.parse(event.textDocument.uri).fsPath]
113+
const filePaths = [URI.file(event.textDocument.uri).fsPath]
114114
await localProjectContextController.updateIndex(filePaths, 'update')
115115
} catch (error) {
116116
logging.error(`Error handling save event: ${error}`)

0 commit comments

Comments
 (0)