in src/language-tools/java.ts [78:104]
async getDocumentTestCases(document: vscode.Uri): Promise<TestFileContents> {
if (!TEST_FILE_REGEX.test(path.basename(document.fsPath))) {
// Evaluate only test files, and not additional classes that are part of a test package.
return {
isTestFile: false,
testCases: [],
}
}
// Check if document symbols feature is enabled
const useDocumentSymbols = getExtensionSetting(
SettingName.JAVA_USE_DOCUMENT_SYMBOLS
)
if (useDocumentSymbols) {
// Attempt to get document symbols via VS Code API.
// TODO(IDE-1109): Request document symbols and process them.
return {
isTestFile: false,
testCases: [],
}
}
// Fallback to resolve directly from document text.
// Due to the variety of VS Code extensions and setups in the JVM ecosystem, this allows basic functionality even if the user is missing other extensions or has them misconfigured.
const result = await this.findTestCasesRegexFallback(document)
return result
}