(codeLens: TemplatedLaunchConfig["codeLens"], workspacePath: string | undefined, filePath: string)
| 68 | } |
| 69 | |
| 70 | function codeLensIsValidForFile(codeLens: TemplatedLaunchConfig["codeLens"], workspacePath: string | undefined, filePath: string) { |
| 71 | if (!codeLens?.path) |
| 72 | return true; |
| 73 | |
| 74 | // Handle globs. |
| 75 | if (codeLens.path.startsWith("**/")) |
| 76 | return minimatch(filePath, codeLens.path, { dot: true }); |
| 77 | |
| 78 | // Otherwise, withinPathOrEqual, which requires a workspacePath. |
| 79 | return workspacePath ? isWithinPathOrEqual(filePath, path.join(workspacePath, codeLens?.path)) : false; |
| 80 | } |
| 81 | |
| 82 | function isTemplateOfType(config: TemplatedLaunchConfig, templateType: string): boolean { |
| 83 | const template = config.codeLens?.for; |
no test coverage detected