Navigation: Implement proper getOriginalElement() for Kotlin declarations.
Run find usages tests with library for both original and navigation elements. Drop duplicating tests. Simplify test class. TODO: Some usages are not found yet since light methods built from library files do not retain original declarations
This commit is contained in:
@@ -127,11 +127,8 @@ public object OptionalParametersHelper {
|
||||
|
||||
//TODO: parameter in overriding method!
|
||||
//TODO: it's a temporary code while we don't have default values accessible from descriptors
|
||||
var declaration = DescriptorToSourceUtilsIde.getAnyDeclaration(project, parameter) as? JetParameter ?: return null
|
||||
if (declaration.getContainingJetFile().isCompiled()) {
|
||||
declaration = JetSourceNavigationHelper.replaceBySourceDeclarationIfPresent(declaration) as? JetParameter ?: return null
|
||||
}
|
||||
val expression = declaration.getDefaultValue() ?: return null
|
||||
val declaration = DescriptorToSourceUtilsIde.getAnyDeclaration(project, parameter)?.getNavigationElement() as? JetParameter
|
||||
val expression = declaration?.getDefaultValue() ?: return null
|
||||
|
||||
val allParameters = (parameter.getContainingDeclaration() as CallableDescriptor).getValueParameters().toSet()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user