Skip to content

Commit 55a5fa2

Browse files
authored
fix(connect-form): fix wsl file path resolving VSCODE-284 (#343)
1 parent 6d6b78f commit 55a5fa2

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

src/test/suite/views/webviewController.test.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -449,11 +449,19 @@ suite('Webview Test Suite', () => {
449449
const fakeWebview = {
450450
html: '',
451451
postMessage: async (message): Promise<void> => {
452-
assert(message.action === 'file_action');
453-
assert(message.files[0] === path.resolve('somefilepath/test.text'));
452+
try {
453+
assert.strictEqual(message.action, 'file_action');
454+
assert.strictEqual(
455+
message.files[0],
456+
'/somefilepath/test.text'
457+
);
458+
459+
done();
460+
} catch (e) {
461+
done(e);
462+
}
454463

455464
await testConnectionController.disconnect();
456-
done();
457465
},
458466
onDidReceiveMessage: (callback): void => {
459467
messageReceived = callback;

src/views/webviewController.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ export default class WebviewController {
131131
command: MESSAGE_TYPES.FILE_PICKER_RESULTS,
132132
action: message.action,
133133
files: (files && files.length > 0)
134-
? files.map((file) => path.resolve(file.path.substr(1)))
134+
? files.map((file) => file.path)
135135
: undefined
136136
});
137137
};

0 commit comments

Comments
 (0)