Text editing at the moment frequently results in changes being made to the source code that introduce new errors. A reasonable heuristic is that additional characters should not be automatically injected into the code if they create an error where there wasn't one before.
For example
/* =======================================
This is a marker
*/
If you place the cursor after the '/*' and before the '======' and press enter the following is created:
/*
*
*/=======================================
This is a marker
*/
This is no longer valid dart code, and the user has to repair the results of the injection being helpful. If the above heuristic was applied it would result in
/*
* =======================================
This is a marker
*/
The same strategy should be applied to automatic injection of parentheses, braces etc. It isn't a perfect heuristic but it is better than the current interaction flow.
Text editing at the moment frequently results in changes being made to the source code that introduce new errors. A reasonable heuristic is that additional characters should not be automatically injected into the code if they create an error where there wasn't one before.
For example
If you place the cursor after the '/*' and before the '======' and press enter the following is created:
This is no longer valid dart code, and the user has to repair the results of the injection being helpful. If the above heuristic was applied it would result in
The same strategy should be applied to automatic injection of parentheses, braces etc. It isn't a perfect heuristic but it is better than the current interaction flow.