Commits

Anonymous committed 1bf224d

Cleaned up some more swank interface.

Comments (0)

Files changed (3)

src/org/lispdev/swank/ISwank.java

 import org.lispdev.swank.runnables.SwankDebugRunnable.DebugInfo;
 import org.lispdev.swank.runnables.SwankPresentationRunnable;
 import org.lispdev.swank.runnables.SwankReadStringRunnable;
+import org.lispdev.swank.runnables.SwankReadStringRunnable.ReadStringInfo;
 import org.lispdev.swank.runnables.SwankRunnable;
 import org.lispdev.swank.runnables.SwankWriteStringRunnable;
 
    * @return Lisp and slime version
    */
   String getLispVersion();
+  /**
+   * Sends message for evaluation. The result is expected to
+   * be received through presentation and writeString listeners.
+   * The callBack does not contain any info and to be used only for
+   * notifying that send eval has finished and results are received
+   */
   void sendEval(String message, SwankRunnable callBack);
-  void sendReadString(String input, SwankRunnable callBack,
-      String num1, String num2);
+  void sendReadString(String input, ReadStringInfo info);
   void sendInterrupt(SwankRunnable callBack);
   void setPackage(String p);
   String getCurrPackage();
    * Send debug restart.
    * @param commandNum restart index
    * @param info debug info obtained at debug start
-   * @param callBack leave it null if want to process events through listeners
+   * @param callBack leave it null if want to process events just
+   * through listeners. The callBack does not have any information
+   * and is used only to notify that sendDebug was successful
    */
   void sendDebug(int commandNum, DebugInfo info, SwankRunnable callBack);
   void sendListThreads(SwankRunnable callBack);
 
   public LispVariable[] getFrameLocals(int frameNum, String threadId,
       LispDebugTarget target);
+
+  @Deprecated
   void addListener(SwankEvent writeString, SwankRunnable displayRunnable);
 
 }

src/org/lispdev/swank/SwankInterface.java

 import org.lispdev.swank.runnables.SwankMacroExpandRunnable;
 import org.lispdev.swank.runnables.SwankPresentationRunnable;
 import org.lispdev.swank.runnables.SwankReadStringRunnable;
+import org.lispdev.swank.runnables.SwankReadStringRunnable.ReadStringInfo;
 import org.lispdev.swank.runnables.SwankRunnable;
 import org.lispdev.swank.runnables.SwankWriteStringRunnable;
 
     swank.sendEvalRaw(msg, pkg, callBack);
   }
 
-  public synchronized void sendReadString(String input, SwankRunnable callBack,
-      String num1, String num2)
+  public synchronized void sendReadString(String input, ReadStringInfo info)
   {
     String msg =
-        "(:emacs-return-string " + num1 + " " + num2 + " \""
+        "(:emacs-return-string " + info.thread + " " + info.tag + " \""
             + SwankInterfaceCore.formatCode(input) + "\")";
-    swank.sendRaw(msg, callBack);
+    swank.sendRaw(msg, null);
   }
 
   public synchronized void sendFindDefinitions(String symbol, String pkg,

src/org/lispdev/swank/SwankInterfaceTest.java

           {
             started.set(true);
             ReadStringInfo info = getInfo();
-            si.sendReadString("abcde\n", null, info.thread, info.tag);
+            si.sendReadString("abcde\n", info);
           }
         }
       }
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.