MCPcopy Create free account
hub / github.com/Dart-Code/Dart-Code / codeLensIsValidForFile

Function codeLensIsValidForFile

src/shared/vscode/debugger.ts:70–80  ·  view source on GitHub ↗
(codeLens: TemplatedLaunchConfig["codeLens"], workspacePath: string | undefined, filePath: string)

Source from the content-addressed store, hash-verified

68}
69
70function 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
82function isTemplateOfType(config: TemplatedLaunchConfig, templateType: string): boolean {
83 const template = config.codeLens?.for;

Callers 1

Calls 1

isWithinPathOrEqualFunction · 0.90

Tested by

no test coverage detected