File tree Expand file tree Collapse file tree 4 files changed +11
-2
lines changed
Expand file tree Collapse file tree 4 files changed +11
-2
lines changed Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change 1+ server-address =47.98.158.183
Original file line number Diff line number Diff line change 1515import com .intellij .openapi .util .TextRange ;
1616import org .jetbrains .annotations .NotNull ;
1717
18+ import java .io .InputStream ;
19+ import java .io .InputStreamReader ;
20+ import java .util .Properties ;
21+
1822public 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 ) {
You can’t perform that action at this time.
0 commit comments