(activeEditor: TextEditor, relative: boolean)
| 66 | } |
| 67 | |
| 68 | function _getPath(activeEditor: TextEditor, relative: boolean) { |
| 69 | const uri = activeEditor.document.uri; |
| 70 | let fsPath = relative ? relativePathToWorkspace(uri) : uriToFsPath(uri); |
| 71 | |
| 72 | const platformPath = getPlatformPath(uri); |
| 73 | if (platformPath === path.win32) { |
| 74 | // Replace all / to \ |
| 75 | fsPath = fsPath.replace(/\//g, "\\"); |
| 76 | } |
| 77 | |
| 78 | const activePos = activeEditor.selection.active; |
| 79 | const line = activePos.line; |
| 80 | const col = activePos.character; |
| 81 | return { fsPath, path: platformPath, line, col }; |
| 82 | } |
| 83 | |
| 84 | function hasDriveLetter(fsPath: string, offset = 0): boolean { |
| 85 | if (fsPath.length >= 2 + offset) { |
no test coverage detected