(target: TargetIDE | TargetURLFunction, data: SourceCodeData)
| 45 | } |
| 46 | |
| 47 | function getTargetURL(target: TargetIDE | TargetURLFunction, data: SourceCodeData): string | void { |
| 48 | |
| 49 | if (typeof target === 'function') return target(data) |
| 50 | |
| 51 | let {projectPath, file, line, column} = data |
| 52 | switch (target) { |
| 53 | case 'vscode': return `vscode://file/${projectPath}/${file}:${line}:${column}` |
| 54 | case 'vscode-insiders': return `vscode-insiders://file/${projectPath}/${file}:${line}:${column}` |
| 55 | case 'atom': return `atom://core/open/file?filename=${projectPath}/${file}&line=${line}&column=${column}` |
| 56 | case 'webstorm': return `webstorm://open?file=${projectPath}/${file}&line=${line}&column=${column}` |
| 57 | } |
| 58 | } |
| 59 | |
| 60 | export const getProjectPath = (): string | undefined => (window as any)[WINDOW_PROJECTPATH_PROPERTY] |
| 61 |
no outgoing calls
no test coverage detected
searching dependent graphs…