Renames - dropped word "Service"
This commit is contained in:
@@ -70,8 +70,8 @@ public abstract class ElementResolver {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
protected ProbablyNothingCallableNamesService probablyNothingCallableNamesService() {
|
protected ProbablyNothingCallableNames probablyNothingCallableNames() {
|
||||||
return DefaultNothingCallableNamesService.INSTANCE$;
|
return DefaultNothingCallableNames.INSTANCE$;
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@@ -101,7 +101,7 @@ public abstract class ElementResolver {
|
|||||||
boolean inBody = body != null && PsiTreeUtil.isAncestor(body, jetElement, false);
|
boolean inBody = body != null && PsiTreeUtil.isAncestor(body, jetElement, false);
|
||||||
Function1<JetElement, Boolean> filter;
|
Function1<JetElement, Boolean> filter;
|
||||||
if (inBody) {
|
if (inBody) {
|
||||||
filter = new PartialBodyResolveFilter(jetElement, body, probablyNothingCallableNamesService());
|
filter = new PartialBodyResolveFilter(jetElement, body, probablyNothingCallableNames());
|
||||||
}
|
}
|
||||||
else { // do as less as possible body-resolve
|
else { // do as less as possible body-resolve
|
||||||
filter = new Function1<JetElement, Boolean>() {
|
filter = new Function1<JetElement, Boolean>() {
|
||||||
|
|||||||
@@ -34,13 +34,13 @@ import org.jetbrains.jet.utils.addToStdlib.firstOrNullIsInstance
|
|||||||
class PartialBodyResolveFilter(
|
class PartialBodyResolveFilter(
|
||||||
elementToResolve: JetElement,
|
elementToResolve: JetElement,
|
||||||
private val body: JetExpression,
|
private val body: JetExpression,
|
||||||
probablyNothingCallableNamesService: ProbablyNothingCallableNamesService
|
probablyNothingCallableNames: ProbablyNothingCallableNames
|
||||||
) : (JetElement) -> Boolean {
|
) : (JetElement) -> Boolean {
|
||||||
|
|
||||||
private val statementTree = StatementTree()
|
private val statementTree = StatementTree()
|
||||||
|
|
||||||
private val nothingFunctionNames = HashSet(probablyNothingCallableNamesService.functionNames())
|
private val nothingFunctionNames = HashSet(probablyNothingCallableNames.functionNames())
|
||||||
private val nothingPropertyNames = probablyNothingCallableNamesService.propertyNames()
|
private val nothingPropertyNames = probablyNothingCallableNames.propertyNames()
|
||||||
|
|
||||||
;{
|
;{
|
||||||
assert(body.isAncestor(elementToResolve, strict = false))
|
assert(body.isAncestor(elementToResolve, strict = false))
|
||||||
|
|||||||
+2
-2
@@ -16,12 +16,12 @@
|
|||||||
|
|
||||||
package org.jetbrains.jet.lang.resolve.lazy
|
package org.jetbrains.jet.lang.resolve.lazy
|
||||||
|
|
||||||
public trait ProbablyNothingCallableNamesService {
|
public trait ProbablyNothingCallableNames {
|
||||||
public fun functionNames(): Set<String>
|
public fun functionNames(): Set<String>
|
||||||
public fun propertyNames(): Set<String>
|
public fun propertyNames(): Set<String>
|
||||||
}
|
}
|
||||||
|
|
||||||
public object DefaultNothingCallableNamesService : ProbablyNothingCallableNamesService {
|
public object DefaultNothingCallableNames : ProbablyNothingCallableNames {
|
||||||
private val hardcodedNames = setOf("error")
|
private val hardcodedNames = setOf("error")
|
||||||
|
|
||||||
override fun functionNames() = hardcodedNames
|
override fun functionNames() = hardcodedNames
|
||||||
@@ -28,9 +28,9 @@ import org.jetbrains.jet.lang.psi.JetElement;
|
|||||||
import org.jetbrains.jet.lang.psi.JetFile;
|
import org.jetbrains.jet.lang.psi.JetFile;
|
||||||
import org.jetbrains.jet.lang.resolve.AdditionalCheckerProvider;
|
import org.jetbrains.jet.lang.resolve.AdditionalCheckerProvider;
|
||||||
import org.jetbrains.jet.lang.resolve.BindingContext;
|
import org.jetbrains.jet.lang.resolve.BindingContext;
|
||||||
import org.jetbrains.jet.lang.resolve.lazy.DefaultNothingCallableNamesService;
|
import org.jetbrains.jet.lang.resolve.lazy.DefaultNothingCallableNames;
|
||||||
import org.jetbrains.jet.lang.resolve.lazy.ElementResolver;
|
import org.jetbrains.jet.lang.resolve.lazy.ElementResolver;
|
||||||
import org.jetbrains.jet.lang.resolve.lazy.ProbablyNothingCallableNamesService;
|
import org.jetbrains.jet.lang.resolve.lazy.ProbablyNothingCallableNames;
|
||||||
import org.jetbrains.jet.lang.resolve.lazy.ResolveSession;
|
import org.jetbrains.jet.lang.resolve.lazy.ResolveSession;
|
||||||
import org.jetbrains.jet.plugin.stubindex.JetProbablyNothingFunctionShortNameIndex;
|
import org.jetbrains.jet.plugin.stubindex.JetProbablyNothingFunctionShortNameIndex;
|
||||||
import org.jetbrains.jet.plugin.stubindex.JetProbablyNothingPropertyShortNameIndex;
|
import org.jetbrains.jet.plugin.stubindex.JetProbablyNothingPropertyShortNameIndex;
|
||||||
@@ -87,13 +87,13 @@ public class ResolveElementCache extends ElementResolver {
|
|||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
protected ProbablyNothingCallableNamesService probablyNothingCallableNamesService() {
|
protected ProbablyNothingCallableNames probablyNothingCallableNames() {
|
||||||
return new ProbablyNothingCallableNamesService() {
|
return new ProbablyNothingCallableNames() {
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Set<String> functionNames() {
|
public Set<String> functionNames() {
|
||||||
// we have to add hardcoded-names until we have Kotlin compiled classes in caches
|
// we have to add hardcoded-names until we have Kotlin compiled classes in caches
|
||||||
Set<String> hardcodedNames = DefaultNothingCallableNamesService.INSTANCE$.functionNames();
|
Set<String> hardcodedNames = DefaultNothingCallableNames.INSTANCE$.functionNames();
|
||||||
Collection<String> indexedNames = JetProbablyNothingFunctionShortNameIndex.getInstance().getAllKeys(project);
|
Collection<String> indexedNames = JetProbablyNothingFunctionShortNameIndex.getInstance().getAllKeys(project);
|
||||||
Set<String> set = new HashSet<String>(hardcodedNames.size() + indexedNames.size());
|
Set<String> set = new HashSet<String>(hardcodedNames.size() + indexedNames.size());
|
||||||
set.addAll(hardcodedNames);
|
set.addAll(hardcodedNames);
|
||||||
|
|||||||
Reference in New Issue
Block a user