Changesets · Branches · Tags · Compare
| Changeset | 95b2bfbfd2aa9bee233c99ce1e78daa3036e5c7e78a62b0b277d543450cb3980 |
|---|---|
| Author | Nate <sestinj@gmail.com> · 2025-09-09 23:10 -07:00 |
| Committer | Nate <sestinj@gmail.com> · 2025-09-09 23:10 -07:00 |
| Parents | ae0f6b584d4f |
1 file changed
modified gui/src/util/clientTools/editImpl.ts +15 −5
| @@ -12,16 +12,20 @@ | ||
| 12 | 12 | "`filepath` and `changes` arguments are required to edit an existing file.", |
| 13 | 13 | ); |
| 14 | 14 | } |
| 15 | + let filepath = args.filepath; | |
| 16 | + if (filepath.startsWith("./")) { | |
| 17 | + filepath = filepath.slice(2); | |
| 18 | + } | |
| 15 | 19 | |
| 16 | 20 | const openFiles = await extras.ideMessenger.ide.getOpenFiles(); |
| 17 | 21 | let firstUriMatch = await resolveRelativePathInDir( |
| 18 | - args.filepath, | |
| 22 | + filepath, | |
| 19 | 23 | extras.ideMessenger.ide, |
| 20 | 24 | ); |
| 21 | 25 | |
| 22 | 26 | if (!firstUriMatch) { |
| 23 | 27 | for (const uri of openFiles) { |
| 24 | - if (uri.endsWith(args.filepath)) { | |
| 28 | + if (uri.endsWith(filepath)) { | |
| 25 | 29 | firstUriMatch = uri; |
| 26 | 30 | break; |
| 27 | 31 | } |
| @@ -29,7 +33,7 @@ | ||
| 29 | 33 | } |
| 30 | 34 | |
| 31 | 35 | if (!firstUriMatch) { |
| 32 | - throw new Error(`${args.filepath} does not exist`); | |
| 36 | + throw new Error(`${filepath} does not exist`); | |
| 33 | 37 | } |
| 34 | 38 | const streamId = uuid(); |
| 35 | 39 | void extras.dispatch( |
| @@ -42,7 +46,13 @@ | ||
| 42 | 46 | ); |
| 43 | 47 | |
| 44 | 48 | return { |
| 45 | - respondImmediately: false, | |
| 46 | - output: undefined, // No immediate output. | |
| 49 | + respondImmediately: true, | |
| 50 | + output: [ | |
| 51 | + { | |
| 52 | + name: "File edited successfully", | |
| 53 | + content: `Successfully initiated edit for ${firstUriMatch}`, | |
| 54 | + description: "File edit operation started", | |
| 55 | + }, | |
| 56 | + ], | |
| 47 | 57 | }; |
| 48 | 58 | }; |