Working in the online editor: problem with indentation

When you hit enter in the online editor, your indentation level is preserved BUT the indentation uses spaces. Even though config.json specifies tabs

This results in the following error

The solution file could not be parsed.
SCRIPT ERROR: Parse Error: Used space character for indentation instead of tab as used before in the file.
          at: GDScript::reload (/mnt/exercism-iteration/darts.gd:3)
          GDScript backtrace (most recent call first):
              [0] load_script (res://test_runner.gd:402)
              [1] load_solution_script (res://test_runner.gd:412)
              [2] _init (res://test_runner.gd:458)
1 Like

That sounds like an upstream bug. Does it sound reasonable for the test runner to pre-parse the solution and turn leading spaces into tags?

I would say yes. There might be an odd case where a multi-line string gets modified. But I’d say cross that bridge if it appears.

https://github.com/exercism/gdscript-test-runner/pull/84

Fix merged. It should work now.

I spoke too soon. https://github.com/exercism/gdscript-test-runner/pull/85

Also unexpand(1)

1 Like

Hah. Thanks for that find! That would have been easily and possibly cleaner. But the PR is already done and this keeps it all in GDScript so I think it’s fine.

1 Like