(uri?: vscode.Uri)
| 60 | } |
| 61 | |
| 62 | export async function getActiveFilePath(uri?: vscode.Uri): Promise<string | undefined> { |
| 63 | let textEditor: vscode.TextEditor | undefined; |
| 64 | if (uri) { |
| 65 | textEditor = await vscode.window.showTextDocument(uri, { preview: false }); |
| 66 | } else { |
| 67 | textEditor = vscode.window.activeTextEditor; |
| 68 | } |
| 69 | |
| 70 | if (!textEditor) { |
| 71 | return undefined; |
| 72 | } |
| 73 | if (textEditor.document.isDirty && !await textEditor.document.save()) { |
| 74 | vscode.window.showWarningMessage("Please save the solution file first."); |
| 75 | return undefined; |
| 76 | } |
| 77 | return wsl.useWsl() ? wsl.toWslPath(textEditor.document.uri.fsPath) : textEditor.document.uri.fsPath; |
| 78 | } |
| 79 | |
| 80 | function isSubFolder(from: string, to: string): boolean { |
| 81 | const relative: string = path.relative(from, to); |
no outgoing calls
no test coverage detected