Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(eclipse): skip version check for non-semantic version string. #3762

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions clients/eclipse/feature/feature.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<feature
id="com.tabbyml.features.tabby4eclipse"
label="Tabby"
version="0.0.2.31"
version="0.0.2.32"
provider-name="com.tabbyml">

<description url="http://www.example.com/description">
Expand All @@ -19,6 +19,6 @@

<plugin
id="com.tabbyml.tabby4eclipse"
version="0.0.2.31"/>
version="0.0.2.32"/>

</feature>
2 changes: 1 addition & 1 deletion clients/eclipse/plugin/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Tabby Plugin for Eclipse
Bundle-SymbolicName: com.tabbyml.tabby4eclipse;singleton:=true
Bundle-Version: 0.0.2.31
Bundle-Version: 0.0.2.32
Bundle-Activator: com.tabbyml.tabby4eclipse.Activator
Bundle-Vendor: com.tabbyml
Require-Bundle: org.eclipse.ui,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ public boolean isEqual(Version other, boolean ignorePatch) {
return this.patch == other.patch;
}

public boolean isZero() {
return this.major == 0 && this.minor == 0 && this.patch == 0;
}

private int parseInt(String str) {
try {
return Integer.parseInt(str);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public static String checkServerHealth(Map<String, Object> serverHealth) {
if (version != null) {
Version parsedVersion = new Version(version);
Version requiredVersion = new Version(MIN_SERVER_VERSION);
if (!parsedVersion.isGreaterOrEqualThan(requiredVersion)) {
if (!parsedVersion.isZero() && !parsedVersion.isGreaterOrEqualThan(requiredVersion)) {
return String.format(
"Tabby Chat requires Tabby server version %s or later. Your server is running version %s.",
MIN_SERVER_VERSION, version);
Expand Down Expand Up @@ -212,24 +212,25 @@ public static boolean openInEditor(FileLocation fileLocation) {
public static void openExternal(String url) {
Program.launch(url);
}

public static List<GitRepository> readGitRepositoriesInWorkspace() {
List<GitRepository> repositories = new ArrayList<>();
IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
IProject[] projects = workspaceRoot.getProjects();

for (IProject project : projects) {
try {
URI projectRootUri = project.getLocation().toFile().toURI();
com.tabbyml.tabby4eclipse.lsp.protocol.GitRepository repo = GitProvider.getInstance().getRepository(new GitRepositoryParams(projectRootUri.toString()));
if (repo != null) {
repositories.add(new GitRepository(repo.getRemoteUrl()));
}
} catch (Exception e) {
logger.warn("Error when read git repository.", e);
}
}
return repositories;
IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
IProject[] projects = workspaceRoot.getProjects();

for (IProject project : projects) {
try {
URI projectRootUri = project.getLocation().toFile().toURI();
com.tabbyml.tabby4eclipse.lsp.protocol.GitRepository repo = GitProvider.getInstance()
.getRepository(new GitRepositoryParams(projectRootUri.toString()));
if (repo != null) {
repositories.add(new GitRepository(repo.getRemoteUrl()));
}
} catch (Exception e) {
logger.warn("Error when read git repository.", e);
}
}
return repositories;
}

public static void setClipboardContent(String content) {
Expand Down Expand Up @@ -261,7 +262,8 @@ public static void applyContentInEditor(String content) {

public static Filepath fileUriToChatPanelFilepath(URI fileUri) {
String fileUriString = fileUri.toString();
com.tabbyml.tabby4eclipse.lsp.protocol.GitRepository gitRepo = GitProvider.getInstance().getRepository(new GitRepositoryParams(fileUriString));
com.tabbyml.tabby4eclipse.lsp.protocol.GitRepository gitRepo = GitProvider.getInstance()
.getRepository(new GitRepositoryParams(fileUriString));
String gitUrl = (gitRepo != null) ? gitRepo.getRemoteUrl() : null;
if (gitUrl != null) {
gitRemoteUrlToLocalRoot.put(gitUrl, gitRepo.getRoot());
Expand Down
Loading