Delete unused method from VirtualFileFinder

This commit is contained in:
Alexander Udalov
2013-09-20 17:43:20 +04:00
parent b42a3e6f6c
commit fa9307d08c
3 changed files with 36 additions and 23 deletions
@@ -17,7 +17,6 @@
package org.jetbrains.jet.cli.jvm.compiler;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.psi.search.GlobalSearchScope;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.jet.lang.resolve.java.header.KotlinClassFileHeader;
@@ -33,14 +32,6 @@ public class CliVirtualFileFinder implements VirtualFileFinder {
classPath = path;
}
@Nullable
@Override
public VirtualFile find(@NotNull FqName className, @NotNull GlobalSearchScope scope) {
//TODO: use scope
return find(className);
}
@Nullable
@Override
public VirtualFile find(@NotNull FqName className) {
@@ -1,17 +1,28 @@
/*
* Copyright 2010-2013 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.jet.lang.resolve.java.vfilefinder;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.psi.search.GlobalSearchScope;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.jet.lang.resolve.name.FqName;
public interface VirtualFileFinder {
@Nullable
VirtualFile find(@NotNull FqName className, @NotNull GlobalSearchScope scope);
//NOTE: uses all scope by default
//TODO: should be removed, scope should always be passed
// TODO: support scope
@Nullable
VirtualFile find(@NotNull FqName className);
}
@@ -1,3 +1,19 @@
/*
* Copyright 2010-2013 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.jet.plugin.vfilefinder;
import com.intellij.openapi.diagnostic.Logger;
@@ -24,8 +40,9 @@ public final class IDEVirtualFileFinder implements VirtualFileFinder {
@Nullable
@Override
public VirtualFile find(@NotNull FqName className, @NotNull GlobalSearchScope scope) {
Collection<VirtualFile> files = FileBasedIndex.getInstance().getContainingFiles(KotlinClassFileIndex.KEY, className, scope);
public VirtualFile find(@NotNull FqName className) {
Collection<VirtualFile> files =
FileBasedIndex.getInstance().getContainingFiles(KotlinClassFileIndex.KEY, className, GlobalSearchScope.allScope(project));
if (files.isEmpty()) {
return null;
}
@@ -34,10 +51,4 @@ public final class IDEVirtualFileFinder implements VirtualFileFinder {
}
return files.iterator().next();
}
@Nullable
@Override
public VirtualFile find(@NotNull FqName className) {
return find(className, GlobalSearchScope.allScope(project));
}
}