Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/ripe-schools-hear.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'click-to-react-component': patch
---

Add support for docker and WSL
7 changes: 6 additions & 1 deletion packages/click-to-react-component/src/getUrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,15 @@
* @param {string} param.pathToSource
*/
export function getUrl({ editor, pathToSource }) {
// Handle remote vscode instance
if (pathToSource.startsWith('vscode-remote')) {
// We assume here the user has overwritten pathToSource, for WSL and docker, and included the correct path
return `${editor}://${pathToSource}`
}
// Fix https://github.com/microsoft/vscode/issues/197319
if (pathToSource[0] === '/') {
return `${editor}://file${pathToSource}`
}

return `${editor}://file/${pathToSource}`
}
}