Skip to content
This repository was archived by the owner on May 8, 2024. It is now read-only.
Open
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
24 changes: 24 additions & 0 deletions .run/Run Plugin.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Run Plugin" type="GradleRunConfiguration" factoryName="Gradle">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" value="" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list>
<option value="runIde" />
</list>
</option>
<option name="vmOptions" />
</ExternalSystemSettings>
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
<DebugAllEnabled>false</DebugAllEnabled>
<RunAsTest>false</RunAsTest>
<method v="2" />
</configuration>
</component>
17 changes: 10 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
plugins {
id 'java'
id 'org.jetbrains.intellij' version '0.4.1'
id "org.jetbrains.intellij" version "1.17.2"
}

group 'com.dmitryzhelnin.intellij.plugin.git.extensions'
version '0.4.4'
version '0.4.5-az'

sourceCompatibility = 1.8
sourceCompatibility = 17

repositories {
mavenCentral()
}

dependencies {
testCompile group: 'junit', name: 'junit', version: '4.12'
testImplementation group: 'junit', name: 'junit', version: '4.13.2'
}

intellij {
intellij.version '2019.3'
intellij.updateSinceUntilBuild false
version = '2022.3'
updateSinceUntilBuild = false
}
11 changes: 6 additions & 5 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
#Fri Mar 15 15:33:19 MSK 2024
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
18 changes: 13 additions & 5 deletions src/main/java/gitextensions/commands/BaseAction.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
package gitextensions.commands;

import com.google.common.base.Strings;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.PlatformDataKeys;
import com.intellij.openapi.actionSystem.*;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.ui.Messages;
import com.intellij.openapi.vfs.VirtualFile;
Expand All @@ -26,11 +24,15 @@ public BaseAction(@NotNull String command) {
this.command = command;
}

@Override
public @NotNull ActionUpdateThread getActionUpdateThread() {
return ActionUpdateThread.BGT; //super.getActionUpdateThread();
}

@Override
public void actionPerformed(@NotNull AnActionEvent e) {
try {
VirtualFile file = e.getData(PlatformDataKeys.VIRTUAL_FILE);
String fileName = getFileName(file);
String fileName = getFileNameFromEvent(e);

if (fileName != null) {
GitExtensionsService service = ApplicationManager.getApplication().getService(GitExtensionsService.class);
Expand All @@ -57,6 +59,12 @@ public void actionPerformed(@NotNull AnActionEvent e) {
}
}

@Nullable
protected String getFileNameFromEvent(@NotNull AnActionEvent e) {
VirtualFile file = e.getData(PlatformDataKeys.VIRTUAL_FILE);
return getFileName(file);
}

protected String getFileName(@Nullable VirtualFile file) {
return file != null ? file.getCanonicalPath() : null;
}
Expand Down
19 changes: 19 additions & 0 deletions src/main/java/gitextensions/commands/Browse.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,26 @@
package gitextensions.commands;

import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.PlatformDataKeys;
import com.intellij.openapi.project.Project;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

public class Browse extends BaseAction {
public Browse() {
super(Commands.BROWSE);
}

@Nullable
@Override
protected String getFileNameFromEvent(@NotNull AnActionEvent e) {
String result = super.getFileNameFromEvent(e);
if (result == null) {
Project project = e.getData(PlatformDataKeys.PROJECT);
if (project != null) {
result = project.getBasePath();
}
}
return result;
}
}
9 changes: 7 additions & 2 deletions src/main/resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<id>com.dmitryzhelnin.intellij.plugin.gitextensions</id>
<name>GitExtensions</name>
<vendor url="https://github.com/DmitryZhelnin/git-extensions-intellij">Dmitry Zhelnin</vendor>
<version>0.4.4</version>
<version>0.4.5-az</version>

<description><![CDATA[
Adds ability to work with <a href="https://github.com/gitextensions/gitextensions">GitExtensions</a> application from IDEs based on the IntelliJ platform
Expand All @@ -11,6 +11,11 @@
<change-notes><![CDATA[
<p>
<ul>
<li>0.4.5</li>
<ul>
<li>Fix usages of deprecated API</li>
<li>Minimum supported version of IntelliJ platform is 223.0 (2022.3)</li>
</ul>
<li>0.4.4</li>
<ul>
<li>Fix usages of deprecated API</li>
Expand Down Expand Up @@ -64,7 +69,7 @@
]]>
</change-notes>

<idea-version since-build="193.0"/>
<idea-version since-build="223.*"/>

<depends>com.intellij.modules.lang</depends>

Expand Down