mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Put stubs for different file types in different directories
This commit is contained in:
@@ -95,6 +95,7 @@ abstract class PrebuiltStubsProviderBase : PrebuiltStubsProvider, Disposable {
|
||||
private var mySerializationManager: SerializationManagerImpl? = null
|
||||
|
||||
protected abstract val stubVersion: Int
|
||||
protected abstract val name: String
|
||||
|
||||
init {
|
||||
init()
|
||||
@@ -184,7 +185,7 @@ abstract class PrebuiltStubsProviderBase : PrebuiltStubsProvider, Disposable {
|
||||
|
||||
@Throws(IOException::class)
|
||||
private fun copyPrebuiltIndexesToIndexRoot(prebuiltIndicesRoot: File): File {
|
||||
val indexRoot = File(IndexInfrastructure.getPersistentIndexRoot(), "prebuilt")
|
||||
val indexRoot = File(IndexInfrastructure.getPersistentIndexRoot(), "prebuilt/" + name)
|
||||
|
||||
FileUtil.copyDir(prebuiltIndicesRoot, indexRoot)
|
||||
|
||||
@@ -197,9 +198,7 @@ abstract class PrebuiltStubsProviderBase : PrebuiltStubsProvider, Disposable {
|
||||
return File(path)
|
||||
}
|
||||
path = PathManager.getHomePath()
|
||||
var f = File(path, "python/index") // from sources
|
||||
if (f.exists()) return f
|
||||
f = File(path, "index") // compiled binary
|
||||
val f = File(path, "index/$name") // compiled binary
|
||||
return if (f.exists()) f else null
|
||||
}
|
||||
}
|
||||
@@ -16,7 +16,9 @@
|
||||
package com.jetbrains.python.psi.impl.stubs;
|
||||
|
||||
import com.intellij.psi.stubs.PrebuiltStubsProviderBase;
|
||||
import com.jetbrains.python.PythonFileType;
|
||||
import com.jetbrains.python.psi.PyFileElementType;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
* @author traff
|
||||
@@ -26,4 +28,10 @@ public class PyPrebuiltStubsProvider extends PrebuiltStubsProviderBase {
|
||||
protected int getStubVersion() {
|
||||
return PyFileElementType.INSTANCE.getStubVersion();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
protected String getName() {
|
||||
return PythonFileType.INSTANCE.getName();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user