379 addScopeElements(at, scope, IDENTITY, accept, IS_PACKAGE.negate().and(smartTypeFilter), result); |
379 addScopeElements(at, scope, IDENTITY, accept, IS_PACKAGE.negate().and(smartTypeFilter), result); |
380 break; |
380 break; |
381 } |
381 } |
382 ImportTree it = findImport(tp); |
382 ImportTree it = findImport(tp); |
383 if (it != null) { |
383 if (it != null) { |
384 addElements(membersOf(at, at.getElements().getPackageElement("").asType(), false), it.isStatic() ? STATIC_ONLY.and(accessibility) : accessibility, smartFilter, result); |
384 // the context of the identifier is an import, look for |
|
385 // package names that start with the identifier. |
|
386 // If and when Java allows imports from the default |
|
387 // package to the the default package which would allow |
|
388 // JShell to change to use the default package, and that |
|
389 // change is done, then this should use some variation |
|
390 // of membersOf(at, at.getElements().getPackageElement("").asType(), false) |
|
391 addElements(listPackages(at, ""), |
|
392 it.isStatic() |
|
393 ? STATIC_ONLY.and(accessibility) |
|
394 : accessibility, |
|
395 smartFilter, result); |
385 } |
396 } |
386 break; |
397 break; |
387 case CLASS: { |
398 case CLASS: { |
388 Predicate<Element> accept = accessibility.and(IS_TYPE); |
399 Predicate<Element> accept = accessibility.and(IS_TYPE); |
389 addScopeElements(at, scope, IDENTITY, accept, smartFilter, result); |
400 addScopeElements(at, scope, IDENTITY, accept, smartFilter, result); |