Delete unused method from VirtualFileFinder
This commit is contained in:
@@ -17,7 +17,6 @@
|
|||||||
package org.jetbrains.jet.cli.jvm.compiler;
|
package org.jetbrains.jet.cli.jvm.compiler;
|
||||||
|
|
||||||
import com.intellij.openapi.vfs.VirtualFile;
|
import com.intellij.openapi.vfs.VirtualFile;
|
||||||
import com.intellij.psi.search.GlobalSearchScope;
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
import org.jetbrains.jet.lang.resolve.java.header.KotlinClassFileHeader;
|
import org.jetbrains.jet.lang.resolve.java.header.KotlinClassFileHeader;
|
||||||
@@ -33,14 +32,6 @@ public class CliVirtualFileFinder implements VirtualFileFinder {
|
|||||||
classPath = path;
|
classPath = path;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Nullable
|
|
||||||
@Override
|
|
||||||
public VirtualFile find(@NotNull FqName className, @NotNull GlobalSearchScope scope) {
|
|
||||||
//TODO: use scope
|
|
||||||
return find(className);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
@Override
|
@Override
|
||||||
public VirtualFile find(@NotNull FqName className) {
|
public VirtualFile find(@NotNull FqName className) {
|
||||||
|
|||||||
+17
-6
@@ -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;
|
package org.jetbrains.jet.lang.resolve.java.vfilefinder;
|
||||||
|
|
||||||
import com.intellij.openapi.vfs.VirtualFile;
|
import com.intellij.openapi.vfs.VirtualFile;
|
||||||
import com.intellij.psi.search.GlobalSearchScope;
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
import org.jetbrains.jet.lang.resolve.name.FqName;
|
import org.jetbrains.jet.lang.resolve.name.FqName;
|
||||||
|
|
||||||
public interface VirtualFileFinder {
|
public interface VirtualFileFinder {
|
||||||
|
// TODO: support scope
|
||||||
@Nullable
|
|
||||||
VirtualFile find(@NotNull FqName className, @NotNull GlobalSearchScope scope);
|
|
||||||
//NOTE: uses all scope by default
|
|
||||||
//TODO: should be removed, scope should always be passed
|
|
||||||
@Nullable
|
@Nullable
|
||||||
VirtualFile find(@NotNull FqName className);
|
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;
|
package org.jetbrains.jet.plugin.vfilefinder;
|
||||||
|
|
||||||
import com.intellij.openapi.diagnostic.Logger;
|
import com.intellij.openapi.diagnostic.Logger;
|
||||||
@@ -24,8 +40,9 @@ public final class IDEVirtualFileFinder implements VirtualFileFinder {
|
|||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
@Override
|
@Override
|
||||||
public VirtualFile find(@NotNull FqName className, @NotNull GlobalSearchScope scope) {
|
public VirtualFile find(@NotNull FqName className) {
|
||||||
Collection<VirtualFile> files = FileBasedIndex.getInstance().getContainingFiles(KotlinClassFileIndex.KEY, className, scope);
|
Collection<VirtualFile> files =
|
||||||
|
FileBasedIndex.getInstance().getContainingFiles(KotlinClassFileIndex.KEY, className, GlobalSearchScope.allScope(project));
|
||||||
if (files.isEmpty()) {
|
if (files.isEmpty()) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -34,10 +51,4 @@ public final class IDEVirtualFileFinder implements VirtualFileFinder {
|
|||||||
}
|
}
|
||||||
return files.iterator().next();
|
return files.iterator().next();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
|
||||||
@Override
|
|
||||||
public VirtualFile find(@NotNull FqName className) {
|
|
||||||
return find(className, GlobalSearchScope.allScope(project));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user