stride
stride copied to clipboard
AssetCompiler - allow TABS in sdpkg
Another easy one. As I push down the "Code Only" approach, this came to light. I added a "Root Asset" to my sdpkg manually, but used TAB instead of 3 spaces, and it crashed the Asset Compiler. It would be great if the Asset Compiler treated TABs as whitespace, just like <SPACE>.
Here was the entry I was trying to make to my sdpkg:
RootAssets: - 1eddabed-b75e-4c92-89d6-6dfa4a96d502:Animations/Run
But mine prefixed with TAB instead of 3 spaces, and it caused critical failure for Asset Compiler. (i.e. "Encountered character that can not start any token.")
This is just YAML spec. I wouldn't try to change that (just like I wouldn't start to use our own flavor of XML allowing both '<' and '[' or something like that).
However, I agree it would be good to have better prevention of such case.
Maybe we should add an .editorconfig
specifying spaces for *.sd*
by default when creating a project?
The issue is with hand-editing, which should occasionally occur. That's how I ran into this.
Perhaps inside the exception handler, it should run some analysis code there to determine the issue -- such as finding the existence of "tabs" and then report that to the user in the error message. So the inefficiency of a more forgiving parser would be circumvented -- this extra logic would only be executed in response to an exception. And for now it would be just a few lines of code to look for 'tabs' -and tell user "Tabs not allowed in .sdpkg; use spaces."