defold / editor2-issues

DEPRECATED
44 stars 4 forks source link

SHIFT + Tab causes NullPointerException #2709

Open gamedev-mario opened 5 years ago

gamedev-mario commented 5 years ago

Expected behaviour

Unindent line.

Actual behaviour

Shows dialogue with NullPointerException.

Steps to reproduce

Pressed SHIFT + TAB in the editor while working on the Walking astronaut tutorial.


Build time2019-08-19T16:51:15.247950
Defold channeleditor-alpha
Defold editor shabe5027e71d3221e122a314d91061b843a8d77a7a
Defold engine sha1a8e53ae9c38a09b742d38dffc6a9f2efdbe6e97
Defold version1.2.160
Errorc0f065ae15214abb9e1fa6be517b867b
GPUIntel(R) HD Graphics 4600
GPU Driver4.3.0 - Build 20.19.15.4624
Java version11.0.1+13
OS archamd64
OS nameWindows 10
OS version10.0
gamedev-mario commented 5 years ago

Seems related to #2357, which was closed.

matgis-king commented 5 years ago
editor.handler$invoke_fnk.invokeStatic.class clojure.lang.ExceptionInfo: handler ':backwards-tab-trigger' in context ':code-view' failed at ':run' with message 'null'
    at editor.handler$invoke_fnk.invokeStatic(handler.clj:71)
    at editor.handler$run.invokeStatic(handler.clj:97)
    at editor.ui$execute_command.invokeStatic(ui.clj:1138)
    at editor.ui$invoke_handler.invokeStatic(ui.clj:1159)
    at editor.ui$invoke_handler.invoke(ui.clj:1153)
    at editor.ui$invoke_handler.invokeStatic(ui.clj:1155)
    at editor.keymap$execute_command$fn.invoke(keymap.clj:578)
    at clojure.lang.AFn.run(AFn.java:22)
    at com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:428)
    at java.security.AccessController.doPrivileged(AccessController.java)
    at com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:427)
    at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
    at com.sun.glass.ui.win.WinApplication._runLoop(WinApplication.java)
    at com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:174)
    at java.lang.Thread.run(Thread.java:834)
clojure.core$rseq.invokeStatic.class java.lang.NullPointerException: null
    at clojure.core$rseq.invokeStatic(core.clj:1587)
    at editor.code.view$find_closest_tab_trigger_word_region.invokeStatic(view.clj:1135)
    at editor.code.view$find_closest_tab_trigger_word_region.invoke(view.clj:1123)
    at clojure.core$partial$fn.invoke(core.clj:2638)
    at clojure.core$mapv$fn.invoke(core.clj:6912)
    at clojure.lang.PersistentVector.reduce(PersistentVector.java:343)
    at clojure.core$reduce.invokeStatic(core.clj:6827)
    at clojure.core$mapv.invokeStatic(core.clj:6903)
    at editor.code.view$select_closest_tab_trigger_word_region_BANG_.invokeStatic(view.clj:1156)
    at editor.code.view$select_closest_tab_trigger_word_region_BANG_.invoke(view.clj:1154)
    at clojure.core$partial$fn.invoke(core.clj:2624)
    at editor.code.view$shift_tab_BANG_.invokeStatic(view.clj:1342)
    at editor.code.view$fn$fnk37859_positional__37862.invoke(view.clj:1350)
    at editor.code.view$fn$fnk37859__37873$fn.invoke(view.clj:1350)
    at editor.code.view$fn$fnk37859__37873.invoke(view.clj:1350)
    at clojure.lang.AFn.applyToHelper(AFn.java:154)
    at clojure.lang.AFn.applyTo(AFn.java:144)
    at clojure.lang.AFunction$1.doInvoke(AFunction.java:31)
    at clojure.lang.RestFn.invoke(RestFn.java:408)
    at editor.handler$invoke_fnk.invokeStatic(handler.clj:65)
    at editor.handler$run.invokeStatic(handler.clj:97)
    at editor.ui$execute_command.invokeStatic(ui.clj:1138)
    at editor.ui$invoke_handler.invokeStatic(ui.clj:1159)
    at editor.ui$invoke_handler.invoke(ui.clj:1153)
    at editor.ui$invoke_handler.invokeStatic(ui.clj:1155)
    at editor.keymap$execute_command$fn.invoke(keymap.clj:578)
    at clojure.lang.AFn.run(AFn.java:22)
    at com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:428)
    at java.security.AccessController.doPrivileged(AccessController.java)
    at com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:427)
    at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
    at com.sun.glass.ui.win.WinApplication._runLoop(WinApplication.java)
    at com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:174)
    at java.lang.Thread.run(Thread.java:834)
matgis-king commented 5 years ago

Hmm. I did not manage to repro this. Please let us know if you're able to make this happen consistently!

gamedev-mario commented 5 years ago

I have figured out how to reproduce it. We are going to try to type if action_id == hash("front") then. While typing this, these are the key-strokes from after ==

h a ENTER (auto-complete for hash) " front " ) DELETE (to remove extra bracket) SPACE then ENTER self.dir.y = 1 ENTER SHIFT + TAB

The key seems to be pressing DELETE, perhaps in concert with the auto-completion. You can SHIFT + TAB while typing self.dir.y = 1 and also get the exception.

vlaaad commented 5 years ago

Thanks, excellent repro case! Managed to make it a bit tighter: ha, ENTER, RIGHT, DELETE, SHIFT+TAB