click-to-react-component
Version:
Option+Click your React components in your browser to open the source file in VS Code
14 lines (12 loc) • 342 B
JavaScript
/**
* @param {Object} param
* @param {string} param.editor
* @param {string} param.pathToSource
*/
export function getUrl({ editor, pathToSource }) {
// Fix https://github.com/microsoft/vscode/issues/197319
if (pathToSource[0] === '/') {
return `${editor}://file${pathToSource}`
}
return `${editor}://file/${pathToSource}`
}