defold / editor2-issues

DEPRECATED
44 stars 4 forks source link

Editing an open text file in external editor makes the editor empty upon return #283

Closed Malmer closed 7 years ago

Malmer commented 7 years ago

Expected behaviour

The changes made in external editor should be visible

Actual behaviour

All the contents of the file is lost. Hitting save when in this state gives the following error:

{:cause nil,
 :via
 [{:type java.lang.NullPointerException,
   :message nil,
   :at
   [com.defold.editor.pipeline.LuaScanner stripSingleLineComments "LuaScanner.java" 55]}],
 :trace
 [[com.defold.editor.pipeline.LuaScanner stripSingleLineComments "LuaScanner.java" 55]
  [com.defold.editor.pipeline.LuaScanner stripComments "LuaScanner.java" 77]
  [com.defold.editor.pipeline.LuaScanner scanProperties "LuaScanner.java" 136]
  [editor.pipeline.lua_scan$src__GT_properties invokeStatic "lua_scan.clj" 38]
  [editor.script$fn__29417 invokeStatic "script.clj" 135]
  [editor.script$fn__29417 invoke "script.clj" 135]
  [clojure.lang.AFn applyToHelper "AFn.java" 154]
  [clojure.lang.AFn applyTo "AFn.java" 144]
  [clojure.lang.AFunction$1 doInvoke "AFunction.java" 29]
  [clojure.lang.RestFn invoke "RestFn.java" 408]
  [clojure.lang.Var invoke "Var.java" 379]
  [editor.script$ScriptNode$behavior$script_properties invokeStatic "script.clj" 135]
  [editor.script$ScriptNode$behavior$script_properties invoke "script.clj" 135]
  [clojure.lang.Var invoke "Var.java" 383]
  [internal.node.OverrideNode produce_value "node.clj" 1609]
  [editor.script$ScriptNode$behavior$user_properties invokeStatic "script.clj" 135]
  [editor.script$ScriptNode$behavior$user_properties invoke "script.clj" 135]
  [clojure.lang.Var invoke "Var.java" 383]
  [internal.node.OverrideNode produce_value "node.clj" 1609]
  [editor.script$ScriptNode$behavior$_properties invokeStatic "script.clj" 135]
  [editor.script$ScriptNode$behavior$_properties invoke "script.clj" 135]
  [clojure.lang.Var invoke "Var.java" 383]
  [internal.node.OverrideNode produce_value "node.clj" 1583]
  [internal.node$pull_first_input_value invokeStatic "node.clj" 1096]
  [editor.game_object$ReferencedComponent$behavior$ddf_properties invokeStatic "game_object.clj" 160]
  [editor.game_object$ReferencedComponent$behavior$ddf_properties invoke "game_object.clj" 160]
  [clojure.lang.Var invoke "Var.java" 383]
  [internal.node.NodeImpl produce_value "node.clj" 271]
  [editor.game_object$ReferencedComponent$behavior$rt_ddf_message invokeStatic "game_object.clj" 160]
  [editor.game_object$ReferencedComponent$behavior$rt_ddf_message invoke "game_object.clj" 160]
  [clojure.lang.Var invoke "Var.java" 383]
  [internal.node.NodeImpl produce_value "node.clj" 271]
  [editor.game_object$ReferencedComponent$behavior$ddf_message invokeStatic "game_object.clj" 160]
  [editor.game_object$ReferencedComponent$behavior$ddf_message invoke "game_object.clj" 160]
  [clojure.lang.Var invoke "Var.java" 383]
  [internal.node.NodeImpl produce_value "node.clj" 271]
  [internal.node$pull_input_values$fn__4474 invoke "node.clj" 1112]
  [clojure.core$mapv$fn__6953 invoke "core.clj" 6627]
  [clojure.lang.PersistentVector reduce "PersistentVector.java" 341]
  [clojure.core$reduce invokeStatic "core.clj" 6544]
  [clojure.core$mapv invokeStatic "core.clj" 6618]
  [internal.node$pull_input_values invokeStatic "node.clj" 1113]
  [editor.game_object$GameObjectNode$behavior$proto_msg invokeStatic "game_object.clj" 307]
  [editor.game_object$GameObjectNode$behavior$proto_msg invoke "game_object.clj" 307]
  [clojure.lang.Var invoke "Var.java" 383]
  [internal.node.NodeImpl produce_value "node.clj" 271]
  [internal.node$pull_first_input_value invokeStatic "node.clj" 1096]
  [editor.collection$EmbeddedGOInstanceNode$behavior$ddf_message invokeStatic "collection.clj" 223]
  [editor.collection$EmbeddedGOInstanceNode$behavior$ddf_message invoke "collection.clj" 223]
  [clojure.lang.Var invoke "Var.java" 383]
  [internal.node.NodeImpl produce_value "node.clj" 271]
  [internal.node$pull_input_values$fn__4474 invoke "node.clj" 1112]
  [clojure.core$mapv$fn__6953 invoke "core.clj" 6627]
  [clojure.lang.PersistentVector reduce "PersistentVector.java" 341]
  [clojure.core$reduce invokeStatic "core.clj" 6544]
  [clojure.core$mapv invokeStatic "core.clj" 6618]
  [internal.node$pull_input_values invokeStatic "node.clj" 1113]
  [editor.collection$CollectionNode$behavior$proto_msg invokeStatic "collection.clj" 444]
  [editor.collection$CollectionNode$behavior$proto_msg invoke "collection.clj" 444]
  [clojure.lang.Var invoke "Var.java" 383]
  [internal.node.NodeImpl produce_value "node.clj" 271]
  [editor.collection$CollectionNode$behavior$save_data invokeStatic "collection.clj" 444]
  [editor.collection$CollectionNode$behavior$save_data invoke "collection.clj" 444]
  [clojure.lang.Var invoke "Var.java" 383]
  [internal.node.NodeImpl produce_value "node.clj" 271]
  [internal.node$pull_input_values$fn__4474 invoke "node.clj" 1112]
  [clojure.core$mapv$fn__6953 invoke "core.clj" 6627]
  [clojure.lang.PersistentVector reduce "PersistentVector.java" 341]
  [clojure.core$reduce invokeStatic "core.clj" 6544]
  [clojure.core$mapv invokeStatic "core.clj" 6618]
  [internal.node$pull_input_values invokeStatic "node.clj" 1113]
  [editor.defold_project$Project$behavior$save_data invokeStatic "defold_project.clj" 461]
  [editor.defold_project$Project$behavior$save_data invoke "defold_project.clj" 461]
  [clojure.lang.Var invoke "Var.java" 383]
  [internal.node.NodeImpl produce_value "node.clj" 271]
  [internal.node$node_value_STAR_ invokeStatic "node.clj" 338]
  [internal.node$node_value invokeStatic "node.clj" 353]
  [dynamo.graph$node_value invokeStatic "graph.clj" 739]
  [editor.defold_project$write_save_data_to_disk_BANG_ invokeStatic "defold_project.clj" 165]
  [editor.defold_project$save_all_BANG_$fn__12137$fn__12138 invoke "defold_project.clj" 262]
  [editor.defold_project$save_all_BANG_$fn__12137 invoke "defold_project.clj" 262]
  [clojure.core$binding_conveyor_fn$fn__4676 invoke "core.clj" 1938]
  [clojure.lang.AFn call "AFn.java" 18]
  [java.util.concurrent.FutureTask run "FutureTask.java" 266]
  [java.util.concurrent.ThreadPoolExecutor runWorker "ThreadPoolExecutor.java" 1142]
  [java.util.concurrent.ThreadPoolExecutor$Worker run "ThreadPoolExecutor.java" 617]
  [java.lang.Thread run "Thread.java" 745]]}

Steps to reproduce

Open a script file in an external editor (eg. sublime) Open the same file in the defold editor Make a change in the file in defold Save All Go to external editor Notice the file is updated Make a change in external editor and save it Return to defold -> Empty file (Optional to produce crash: Hit Cmd+S)


Defold version: 1.2.95 Defold sha: 3d3b4872c5dc544f1cc7d454b826f7193842d4f2 Platform: Mac OS X 10.12.1 (x86_64) Java version: 1.8.0_102-b14

Malmer commented 7 years ago

Trying to repro the bug it works as intended. So I guess is a bug that may require some other condition to be met.

RagnarSvenssonKing commented 7 years ago

Will be fixed as part of DEFEDIT-614

ragnard-king commented 7 years ago

Fixed by defold/defold#1158