Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(desktop): open cursor:// and vscode:// file links from chat #23486

Mergedfixfon(GitHub profile, opens in a new tab)merged 2 commits intomain fromrefs/pull/23486/headmerged by Yash-Singh1(GitHub profile, opens in a new tab) View on GitHub

Showing 9 changed files with 91 additions and 2 deletions (loading 6).

x
0 of 9 viewed, 9 left
61 additions and 0 deletionsapps/desktop/src/electron/ElectronShell.test.tsModified
View file
@@ -54,6 +54,67 @@
}).pipe(Effect.provide(ElectronShell.layer)),
);
​
+ it.effect("opens local editor file deep links", () =>
+ Effect.gen(function* () {
+ openExternalMock.mockResolvedValue(undefined);
+​
+ const urls = [
+ "cursor://file/Users/me/repo/file.md:186",
+ "vscode://file/Users/me/repo/file.md:3:7",
+ "vscode-insiders://file/Users/me/repo/file.md",
+ "vscodium://file/C:/Users/me/repo/file.md:3",
+ ];
+ const electronShell = yield* ElectronShell.ElectronShell;
+ const results = yield* Effect.forEach(urls, (url) => electronShell.openExternal(url));
+​
+ assert.deepEqual(results, [true, true, true, true]);
+ assert.deepEqual(
+ openExternalMock.mock.calls,
+ urls.map((url) => [url]),
+ );
+ }).pipe(Effect.provide(ElectronShell.layer)),
+ );
+​
+ it.effect("normalizes the scheme case of local editor file deep links", () =>
+ Effect.gen(function* () {
+ openExternalMock.mockResolvedValue(undefined);
+​
+ const electronShell = yield* ElectronShell.ElectronShell;