Skip to content

Commit 0d3d346

Browse files
committed
fix intellij github api removal issue
1 parent ddf647c commit 0d3d346

23 files changed

+198
-393
lines changed

build.gradle

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,14 @@ version "${version}"
1515
sourceCompatibility = JavaVersion.VERSION_1_8
1616

1717
repositories {
18+
mavenLocal()
1819
mavenCentral()
1920
}
2021

2122
dependencies {
23+
// https://mvnrepository.com/artifact/org.kohsuke/github-api
24+
implementation(files("libs/github-api-1.309-SNAPSHOT.jar"))
25+
2226
testCompile group: 'junit', name: 'junit', version: '4.12'
2327
}
2428

changeNotes.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
<ul>
2-
<li>Migrate deprecated apis</li>
3-
<li>Improve ui operation</li>
2+
<li>Use github-api rather than intellij github plugin</li>
43
</ul>

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version = 1.0.3
1+
version = 1.1.0
22
ideaVersion = IC-2019.1
33
customUtilBuild = 299.*
44
isEAP = false

libs/github-api-1.309-SNAPSHOT.jar

574 KB
Binary file not shown.

src/main/java/com/chuntung/plugin/gistsnippet/action/AddAction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2020 Tony Ho. Some rights reserved.
2+
* Copyright (c) 2020 Chuntung Ho. Some rights reserved.
33
*/
44

55
package com.chuntung.plugin.gistsnippet.action;

src/main/java/com/chuntung/plugin/gistsnippet/action/CustomComboBoxAction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2020 Tony Ho. Some rights reserved.
2+
* Copyright (c) 2020 Chuntung Ho. Some rights reserved.
33
*/
44

55
package com.chuntung.plugin.gistsnippet.action;

src/main/java/com/chuntung/plugin/gistsnippet/action/DeleteAction.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2020 Tony Ho. Some rights reserved.
2+
* Copyright (c) 2020 Chuntung Ho. Some rights reserved.
33
*/
44

55
package com.chuntung.plugin.gistsnippet.action;
@@ -70,9 +70,9 @@ public void actionPerformed(@NotNull AnActionEvent e) {
7070

7171
@Override
7272
public void run(@NotNull ProgressIndicator indicator) {
73-
GithubAccount account = GithubAccountHolder.getInstance(project).getAccount();
73+
String token = GithubAccountHolder.getInstance(project).getAccessToken();
7474
GistSnippetService service = GistSnippetService.getInstance();
75-
service.deleteGist(account, gistIds);
75+
service.deleteGist(token, gistIds);
7676
deleted = true;
7777
}
7878

src/main/java/com/chuntung/plugin/gistsnippet/action/EditAction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2020 Tony Ho. Some rights reserved.
2+
* Copyright (c) 2020 Chuntung Ho. Some rights reserved.
33
*/
44

55
package com.chuntung.plugin.gistsnippet.action;

src/main/java/com/chuntung/plugin/gistsnippet/action/InsertAction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2020 Tony Ho. Some rights reserved.
2+
* Copyright (c) 2020 Chuntung Ho. Some rights reserved.
33
*/
44

55
package com.chuntung.plugin.gistsnippet.action;

src/main/java/com/chuntung/plugin/gistsnippet/action/OpenInBrowserAction.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
/*
2-
* Copyright (c) 2020 Tony Ho. Some rights reserved.
2+
* Copyright (c) 2020 Chuntung Ho. Some rights reserved.
33
*/
44

55
package com.chuntung.plugin.gistsnippet.action;
66

7+
import com.chuntung.plugin.gistsnippet.dto.FileNodeDTO;
78
import com.chuntung.plugin.gistsnippet.dto.SnippetNodeDTO;
8-
import com.chuntung.plugin.gistsnippet.dto.api.GistFileDTO;
99
import com.intellij.ide.BrowserUtil;
10-
import com.intellij.openapi.actionSystem.AnAction;
1110
import com.intellij.openapi.actionSystem.AnActionEvent;
1211
import com.intellij.openapi.project.DumbAwareAction;
1312
import org.jetbrains.annotations.NotNull;
@@ -34,8 +33,8 @@ public void actionPerformed(@NotNull AnActionEvent e) {
3433
String url = null;
3534
if (userObject instanceof SnippetNodeDTO) {
3635
url = ((SnippetNodeDTO) userObject).getHtmlUrl();
37-
} else if (userObject instanceof GistFileDTO) {
38-
url = ((GistFileDTO) userObject).getRawUrl();
36+
} else if (userObject instanceof FileNodeDTO) {
37+
url = ((FileNodeDTO) userObject).getRawUrl();
3938
}
4039
if (url != null) {
4140
BrowserUtil.open(url);

0 commit comments

Comments
 (0)