mirror of
https://github.com/carlrobertoh/ProxyAI.git
synced 2026-05-12 14:10:29 +00:00
Reopen plugin's source code (1.10.8 → 2.0.5)
This commit is contained in:
parent
faf02a5c0a
commit
26a3e07360
231 changed files with 88014 additions and 4271 deletions
39
src/main/java/ee/carlrobert/codegpt/CodeGPTPlugin.java
Normal file
39
src/main/java/ee/carlrobert/codegpt/CodeGPTPlugin.java
Normal 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";
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue