Closed tamzinblake closed 13 years ago
An instance of this problem (was issue #3)
What happens:
var error_text = {
code_label: 'Error Code: ',
http_label: 'HTTP error',
}
What should happen:
var error_text = {
code_label: 'Error Code: ',
http_label: 'HTTP error',
}
The previous strategy I was going to use to fix this was:
However, the parser is way too slow, so it would be really annoying if waiting for the parser to catch up was the usual behavior. Instead, the problem must be solved with more regexes!
It is officially impossible to determine whether an identifier belongs to a preceding var statement without actually parsing the JS. This issue is closed - if you want better behavior, either repeat the 'var' statement or use comma-first notation which is insanely easier to line up correctly.
Turns out we really just needed to reparse before indentation. Who knew?
After a var statement (in cases where one is not using comma-first), lines are sometimes indented incorrectly if the js2-mode parser hasn't caught up yet. The current workaround is:
In the future, this behavior shouldn't happen at all.