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