Vetur: Assigning elements from a stylus hash adds a set of parentheses on each save

Created on 14 Jan 2018  路  4Comments  路  Source: vuejs/vetur

<style lang="stylus" scoped>
$abc = {
  one: 1,
  two: 2
}
$abc[three] = $abc.one + 2 // 馃憥  becomes: $abc[three] = ($abc.one + 2)
$abc.four = $abc[two] + 2 // 馃憥 becomes: $abc.four = ($abc[two] + 2)
$abc[five] = 2 + 3 // 馃憤 nothing gets added
$abc.six = 6 // 馃憤 nothing gets added 
</style>

Each time you save, a new set of parentheses gets added. Eventually you might end up with something like $abc[three] = ((((((((((((($abc.one + 2)))))))))))))

bug formatting

Most helpful comment

This should be fixed by https://github.com/vuejs/vetur/pull/659

All 4 comments

Also, the same happens when adding multiple box shadows (separated by commas):

box-shadow: inset 0 -9px 0 ((($color.blue))), inset 0 9px 0 ((($color.blue)))

cc @ThisIsManta

I cannot reproduce @nachocab 's report, but I do find other glitch.

Before:
screen shot 2018-01-15 at 2 30 43 pm

After:
screen shot 2018-01-15 at 2 30 49 pm

Thanks for letting me know. I'll check this out after my vacation.

This should be fixed by https://github.com/vuejs/vetur/pull/659

Was this page helpful?
0 / 5 - 0 ratings