Minor. Extract method
This commit is contained in:
@@ -103,10 +103,7 @@ public class ScriptHeaderResolver {
|
|||||||
FqName fqName = file.getPackageFqName();
|
FqName fqName = file.getPackageFqName();
|
||||||
PackageFragmentDescriptor ns = packageFragmentProvider.getOrCreateFragment(fqName);
|
PackageFragmentDescriptor ns = packageFragmentProvider.getOrCreateFragment(fqName);
|
||||||
|
|
||||||
Integer priority = script.getUserData(PRIORITY_KEY);
|
Integer priority = getScriptPriority(script);
|
||||||
if (priority == null) {
|
|
||||||
priority = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
FqName nameForScript = ScriptNameUtil.classNameForScript((JetFile) script.getContainingFile());
|
FqName nameForScript = ScriptNameUtil.classNameForScript((JetFile) script.getContainingFile());
|
||||||
Name className = nameForScript.shortName();
|
Name className = nameForScript.shortName();
|
||||||
@@ -123,6 +120,11 @@ public class ScriptHeaderResolver {
|
|||||||
outerScope.addClassifierDescriptor(scriptDescriptor.getClassDescriptor());
|
outerScope.addClassifierDescriptor(scriptDescriptor.getClassDescriptor());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static int getScriptPriority(@NotNull JetScript script) {
|
||||||
|
Integer priority = script.getUserData(PRIORITY_KEY);
|
||||||
|
return priority == null ? 0 : priority;
|
||||||
|
}
|
||||||
|
|
||||||
public void resolveScriptDeclarations(@NotNull TopDownAnalysisContext c) {
|
public void resolveScriptDeclarations(@NotNull TopDownAnalysisContext c) {
|
||||||
for (Map.Entry<JetScript, ScriptDescriptor> e : c.getScripts().entrySet()) {
|
for (Map.Entry<JetScript, ScriptDescriptor> e : c.getScripts().entrySet()) {
|
||||||
JetScript declaration = e.getKey();
|
JetScript declaration = e.getKey();
|
||||||
|
|||||||
Reference in New Issue
Block a user