Reopen plugin's source code (1.10.8 → 2.0.5)

This commit is contained in:
Carl-Robert Linnupuu 2023-08-25 16:36:22 +03:00
parent faf02a5c0a
commit 26a3e07360
231 changed files with 88014 additions and 4271 deletions

View file

@ -0,0 +1,39 @@
package ee.carlrobert.codegpt;
import static java.util.Objects.requireNonNull;
import com.intellij.ide.plugins.PluginManagerCore;
import com.intellij.openapi.application.PathManager;
import com.intellij.openapi.extensions.PluginId;
import com.intellij.openapi.project.Project;
import java.io.File;
import java.nio.file.Path;
import org.jetbrains.annotations.NotNull;
public final class CodeGPTPlugin {
public static final PluginId CODEGPT_ID = PluginId.getId("ee.carlrobert.chatgpt");
private CodeGPTPlugin() {
}
public static @NotNull Path getPluginBasePath() {
return requireNonNull(PluginManagerCore.getPlugin(CODEGPT_ID)).getPluginPath();
}
public static @NotNull String getPluginOptionsPath() {
return PathManager.getOptionsPath() + File.separator + "CodeGPT";
}
public static @NotNull String getIndexStorePath() {
return getPluginOptionsPath() + File.separator + "indexes";
}
public static @NotNull String getProjectIndexStorePath(@NotNull Project project) {
return getIndexStorePath() + File.separator + project.getName();
}
public static @NotNull String getProjectIndexPath(@NotNull Project project) {
return getProjectIndexStorePath(project) + File.separator + "hnsw.index";
}
}