Skip to content

Fix empty list of JavaScript classes bug #1946

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,16 @@ object JsLanguageAssistant : LanguageAssistant() {
// TODO: generate tests for all classes, not only the first one
// (currently not possible since breaks JsTestGenerator routine)
if (memberInfos.isEmpty()) {
val classes = file.statements.filterIsInstance<ES6Class>()
if (classes.isEmpty()) return null

memberInfos = generateMemberInfo(
e.project!!,
emptyList(),
file.statements.filterIsInstance<ES6Class>().first()
classes.first()
)
if (memberInfos.isEmpty()) return null

focusedMethodMI = memberInfos.first()
}
return PsiTargets(
Expand Down