Skip to content

Commit b37e6cd

Browse files
committed
refactor shortcut
1 parent fbe2b7d commit b37e6cd

File tree

4 files changed

+11
-2
lines changed

4 files changed

+11
-2
lines changed
371 Bytes
Binary file not shown.

deepcommenter-client/resources/META-INF/plugin.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
<action id="TestGeneration.GenerateCommentAction" class="tech.czxs.deepcommenter.GenerateCommentAction"
3131
text="Generate Comment" description="generate comment for select sentences">
3232
<add-to-group group-id="CodeMenu" anchor="after" relative-to-action="Generate"/>
33-
<keyboard-shortcut keymap="$default" first-keystroke="meta alt SLASH"/>
33+
<keyboard-shortcut keymap="$default" first-keystroke="ctrl alt SLASH"/>
3434
</action>
3535
</actions>
3636

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
server-address=47.98.158.183

deepcommenter-client/src/tech/czxs/deepcommenter/GenerateCommentAction.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@
1515
import com.intellij.openapi.util.TextRange;
1616
import org.jetbrains.annotations.NotNull;
1717

18+
import java.io.InputStream;
19+
import java.io.InputStreamReader;
20+
import java.util.Properties;
21+
1822
public class GenerateCommentAction extends AnAction {
1923

2024
@Override
@@ -49,8 +53,12 @@ public void run(@NotNull ProgressIndicator indicator) {
4953
// }
5054
String result;
5155
try {
56+
Properties props = new Properties();
57+
props.load(this.getClass().getResourceAsStream("/server.properties"));
58+
String serverAddr = props.getProperty("server-address");
59+
5260
String s = selectedText;
53-
result = HttpClientPool.getHttpClient().post("http://47.98.158.183:5000/s", s);
61+
result = HttpClientPool.getHttpClient().post("http://"+ serverAddr + ":5000/s", s);
5462
// result = HttpClientPool.getHttpClient().post("http://127.0.0.1:5000/s", s);
5563

5664
} catch (Exception ex) {

0 commit comments

Comments
 (0)