uqbar-project / wollok

Wollok Programming Language
GNU General Public License v3.0
60 stars 16 forks source link

Avoid renaming a file with a space #1274

Open fdodino opened 7 years ago

fdodino commented 7 years ago

Because that breaks launchers. Suppose you have a file named describe.wtest, you press F2 and rename it as "desc ribe.wtest". If you try to run a test, a stack trace is shown:

java.lang.NullPointerException
    at org.uqbar.project.wollok.launch.WollokChecker.parse(WollokChecker.java:126)
    at org.uqbar.project.wollok.launch.WollokChecker.lambda$0(WollokChecker.java:139)
    at org.eclipse.xtext.xbase.lib.internal.FunctionDelegate.apply(FunctionDelegate.java:42)
    at com.google.common.collect.Lists$TransformingRandomAccessList.get(Lists.java:572)
    at java.util.AbstractList$Itr.next(AbstractList.java:358)
    at org.eclipse.xtext.xbase.lib.IteratorExtensions.fold(IteratorExtensions.java:643)
    at org.eclipse.xtext.xbase.lib.IterableExtensions.fold(IterableExtensions.java:554)
    at org.uqbar.project.wollok.launch.WollokLauncherInterpreterEvaluator.evaluateAll(WollokLauncherInterpreterEvaluator.java:127)
    at org.uqbar.project.wollok.interpreter.WollokInterpreterEvaluator.evaluateAll(WollokInterpreterEvaluator.java:1)
    at org.uqbar.project.wollok.interpreter.WollokInterpreter.interpret(WollokInterpreter.java:132)
    at org.uqbar.project.wollok.interpreter.WollokInterpreter.interpret(WollokInterpreter.java:113)
    at org.uqbar.project.wollok.launch.WollokLauncher.doSomething(WollokLauncher.java:53)
    at org.uqbar.project.wollok.launch.WollokChecker.launch(WollokChecker.java:95)
    at org.uqbar.project.wollok.launch.WollokChecker.doMain(WollokChecker.java:76)
    at org.uqbar.project.wollok.launch.WollokLauncher.main(WollokLauncher.java:39)
fdodino commented 6 years ago

Tried to fix this several ways:

So I decided to postpone until I feel more comfortable with XText Refactoring API. This article didn't help: http://koehnlein.blogspot.com.ar/2011/06/rename-refactoring-in-xtext-20.html