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

Function isValidEntryFile

src/extension/utils.ts:172–183  ·  view source on GitHub ↗
(file: string | undefined)

Source from the content-addressed store, hash-verified

170}
171
172export function isValidEntryFile(file: string | undefined) {
173 if (!file || !isDartFile(file))
174 return false;
175
176 // When in a no-folder workspace, all Dart files are considered runnable.
177 if (!workspace.workspaceFolders?.length)
178 return true;
179
180 return isTestFile(file)
181 || isInsideFolderNamed(file, "bin") || isInsideFolderNamed(file, "tool") || isInsideFolderNamed(file, "test_driver")
182 || file.endsWith(`lib${path.sep}main.dart`);
183}
184
185export function getLatestSdkVersion(): Promise<string> {
186 return new Promise<string>((resolve, reject) => {

Callers 2

guessBestEntryPointMethod · 0.90

Calls 3

isDartFileFunction · 0.85
isTestFileFunction · 0.85
isInsideFolderNamedFunction · 0.85

Tested by

no test coverage detected