Changeset 352
- Timestamp:
- 09/14/08 11:32:07 (4 months ago)
- Files:
-
- jasko.tim.lisp/src/jasko/tim/lisp/builder/LispBuilder.java (modified) (5 diffs)
- jasko.tim.lisp/src/jasko/tim/lisp/navigator/LoadAsdAction.java (modified) (1 diff)
- jasko.tim.lisp/src/jasko/tim/lisp/navigator/LoadProjectAction.java (modified) (1 diff)
- jasko.tim.lisp/src/jasko/tim/lisp/swank/SwankInterface.java (modified) (2 diffs)
- jasko.tim.lisp/src/jasko/tim/lisp/wizards/NewProjectWiz.java (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
jasko.tim.lisp/src/jasko/tim/lisp/builder/LispBuilder.java
r348 r352 219 219 String asdFile = ""; 220 220 boolean removeCompileMarkers = true; 221 boolean switchToPackage = false; //only when compiledByAsd 221 222 222 223 public CompileListener(IFile file, boolean removeCompileMarkers) { … … 229 230 } 230 231 231 public CompileListener(boolean compByAsd, String asdfile ) {232 public CompileListener(boolean compByAsd, String asdfile, boolean switchToPackage) { 232 233 this.file = null; 233 234 offset = 0; … … 235 236 compiledByAsd = true; 236 237 asdFile = asdfile; 238 this.switchToPackage = switchToPackage; 237 239 } 240 238 241 public CompileListener(IFile file, int offset, int length) { 239 242 this.file = file; … … 257 260 if ( guts.isEmpty() || guts.value.equalsIgnoreCase("nil") ){ 258 261 if( compiledByAsd ){ 259 repl.appendText("Loaded package " + asdFile + "\n"); 262 if( repl != null ){ 263 repl.appendText("Loaded package " + asdFile + "\n"); 264 File asdf = new File(asdFile); 265 String pkg = asdf.getName(); 266 pkg = pkg.substring(0,pkg.length() - ".asd".length()); 267 repl.switchPackage(pkg); 268 } 260 269 } 261 270 } else { … … 323 332 torepl += "warnings"; 324 333 } 325 repl.appendText(torepl); 334 if(repl != null){ 335 repl.appendText(torepl); 336 } 326 337 } 327 338 } jasko.tim.lisp/src/jasko/tim/lisp/navigator/LoadAsdAction.java
r347 r352 30 30 IFile file = (IFile) obj; 31 31 LispMarkers.deletePackageErrorMarkers(file.getProject()); 32 String asdfile = file.getLocation().toString(); 33 LispPlugin.getDefault().getSwank().compileAndLoadAsd(file); 34 /* LispPlugin.getDefault().getSwank().sendLoadASDF(asdfile, 35 new LispBuilder.CompileListener(true,asdfile)); */ 32 LispPlugin.getDefault().getSwank().compileAndLoadAsd(file,false); 36 33 } 37 34 } jasko.tim.lisp/src/jasko/tim/lisp/navigator/LoadProjectAction.java
r347 r352 50 50 if (asdFile != null) { 51 51 LispMarkers.deletePackageErrorMarkers(project); 52 LispPlugin.getDefault().getSwank().compileAndLoadAsd(file );52 LispPlugin.getDefault().getSwank().compileAndLoadAsd(file,false); 53 53 } else { 54 54 MessageBox mbox = new MessageBox(this.getWorkbench().getDisplay().getActiveShell(), jasko.tim.lisp/src/jasko/tim/lisp/swank/SwankInterface.java
r347 r352 1302 1302 } 1303 1303 1304 public void compileAndLoadAsd(IFile file ){1304 public void compileAndLoadAsd(IFile file, boolean switchToPackage){ 1305 1305 if( file == null ){ 1306 1306 return; … … 1316 1316 if( fext != null && fext.equalsIgnoreCase("asd") ){ 1317 1317 registerLibPath(path); 1318 registerCallback(new LispBuilder.CompileListener(true,fullpath ));1318 registerCallback(new LispBuilder.CompileListener(true,fullpath,switchToPackage)); 1319 1319 String msg = "(swank:operate-on-system-for-emacs \"" + name + "\" \"LOAD-OP\")"; 1320 1320 emacsRex(msg); jasko.tim.lisp/src/jasko/tim/lisp/wizards/NewProjectWiz.java
r347 r352 13 13 import jasko.tim.lisp.LispPlugin; 14 14 import jasko.tim.lisp.builder.LispNature; 15 import jasko.tim.lisp.swank.SwankRunnable;16 15 import jasko.tim.lisp.views.*; 17 16 … … 184 183 185 184 // Make the tests file 185 final IFile tests = newProject.getFile("tests.lisp"); 186 186 if( useLispUnit ){ 187 187 contents = Templater.getTemplate("tests.lisp", pkg, useLispUnit, makeExample); 188 final IFile tests = newProject.getFile("tests.lisp");189 188 if (!tests.exists()) { 190 189 tests.create(contents, true, monitor); … … 201 200 202 201 203 // Load asd file. 204 String asdfile = asd.getLocation().toString(); 205 LispPlugin.getDefault().getSwank().compileAndLoadAsd(asd); 206 /* LispPlugin.getDefault().getSwank().sendLoadASDF(asdfile, 207 new SwankRunnable() { 208 public void run() { 209 ReplView rv = ReplView.getInstance(); 210 if (rv != null) { 211 rv.switchPackage(pkg); 212 } 213 } 214 }); */ 215 ReplView rv = ReplView.getInstance(); 216 if (rv != null) { 217 rv.switchPackage(pkg); 218 } 219 220 202 LispPlugin.getDefault().getSwank().compileAndLoadAsd(asd,true); 203 221 204 monitor.setTaskName("Opening files for editing..."); 222 205 getShell().getDisplay().asyncExec(new Runnable() { … … 228 211 IDE.openEditor(page, defpackage, true); 229 212 IDE.openEditor(page, main, true); 213 IDE.openEditor(page, tests, true); 230 214 231 215 … … 239 223 240 224 monitor.worked(2); 241 monitor.done(); 242 225 monitor.done();/* 226 ReplView rv = ReplView.getInstance(); 227 if (rv != null) { 228 rv.switchPackage(pkg); 229 }*/ 243 230 } // void doFinish(...) 244 231
