Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
问题背景 (临时错误代码不同步引擎,IDE 代码同步 AST 过于高频,且没有必要)
目前 IDE 合法的代码同步至 Workspace 时机:
如果视为纯在线编码的沙箱,应该允许用户任意输入
可能的解决方案(重构 IDE 刷新时机 / AST 解析时机)
Workspace.File 新增 tempCode 字段
AST 同步时机调整
进入 WEBIDE (预览模式)
进入 IDE 时,ast2code 同步一次代码至 IDE
此时保持预览模式,纯 IDE + 沙箱场景,没有引擎 AST 解析干预
退出 IDE (切回设计模式)
离开 IDE 时,code2ast(updateFile) 同步一次 IDE 代码至 Workspace
问题
IDE 模式下,会造成可视化面板跟 IDE 内代码不同步的问题
可能的解决方式:
结论待定
对整体 Tango 设计有较大影响面,如约束用户禁止写错误代码,允许错误代码被回滚的问题,上述均可暂不处理