WarWithinMe / better-align

A vscode extension to provide better vertical alignment
Other
75 stars 39 forks source link

Force-ignore characters when aligning? #69

Open ErikBraun251 opened 3 years ago

ErikBraun251 commented 3 years ago

Thank you for your great addon. Is there a way (optimal: language specific) to tell Better Align to ignore specific characters when aligning?

Example (Source)

self.total_waves:int = -1
self.level_mult_per_wave:float = 1.1
self.victory_condition[0] = VictoryCondition.NEVER
self.victory_condition[1] = VictoryCondition.DESTROY_ALL
self.enemies_per_wave[1] = lambda: int(1 + math.log(self.wave_count + 1))
self.progress_title = lambda: 'Wave'
self.progress_subtitle = lambda: str(self.wave_count)
self.boss_spawn = 10

results in:

self.total_waves        :int                    = -1
self.level_mult_per_wave:float                  = 1.1
self.victory_condition  [0]                     = VictoryCondition.NEVER
self.victory_condition  [1]                     = VictoryCondition.DESTROY_ALL
self.enemies_per_wave   [1]                     = lambda: int(1 + math.log(self.wave_count + 1))
                         self.progress_title    = lambda: 'Wave'
                         self.progress_subtitle = lambda: str(self.wave_count)
                         self.boss_spawn        = 10

expected result: ignore brackets and colon, only align by assignment:

self.total_waves:int           = -1
self.level_mult_per_wave:float = 1.1
self.victory_condition[0]      = VictoryCondition.NEVER
self.victory_condition[1]      = VictoryCondition.DESTROY_ALL
self.enemies_per_wave[1]       = lambda: int(1 + math.log(self.wave_count + 1))
self.progress_title            = lambda: 'Wave'
self.progress_subtitle         = lambda: str(self.wave_count)
self.boss_spawn                = 10