-
Notifications
You must be signed in to change notification settings - Fork 389
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Align groups of assignments (=) #1029
Comments
I do this manually worry alignment extension, but when applying the settings from this it eliminates the alignment, so I'd agree this would be nice to have. |
There is already a rule called |
I'm interested in people's opinion on this. I personally think adding this many blank spaces is unnecessary and actually often ends up in increasing line length to the point that you have to break onto the line below. I would not agree that this is desirable behavior as the default. |
Personally I quite never experience that issue so it might be related to window width/editor width rather than the length of the line itself. I would say that it boils down to personal preference. Anyways my intent was that it would be an option, not necessarily the default behavior. |
I am talking about having to break line because you are sticking to a set line length, for example 115 characters, which is seen as a good practice generally in most programming languages. |
Of course, but I still rarely have issues with exceeding that line length, maybe naming could be the reason why you often exceed that length? Still I would argue that it comes down to personal preference and if the setting does not fit your way of coding you are free to enable/disable it. |
@ryan-jan @hanpq VS-Code has the |
@bergmeister How do you mean? I'm afraid the discussion is drifting off topic, how is that connected to alignment of assignment groups? |
@hanpq This was just a general comment if line length is a concern |
Ah ok :) |
I'm in 1.17.1 version and |
I'd like to be able to add more alignments like this. I rather like the BlockAlign extension (https://github.com/crewone/vscode-blockalign), but of course it doesn't play well with overall formatting which is a shame, if entirely understandable. |
I actually have trouble interpreting the configuration of the
👉 I don't think that a linter/analyzer should automatically fix any violations!
The configuration variables don't map to expected behavior: 💡 If So what I expect, even after reading the documentation, is this:
👉 Any automatic "fix" should be implemented in the Formatter, not the Analyzer! |
Hi, 👋 I know this is an issue that dates back a while. I use VSCode and -so far- I haven't found any alignment extension that work properly with PowerShell .ps1 files. Please, it would be very helpful if someone with knowledge of the project could enable this functionality based on what was mentioned in the different posts on this issue and in some other issues such as the enum's related one. 🙏Many thanks to everyone who has contributed to this useful project. |
I made the below feature request in the vscode-powershell extension git and was enlightened that this functionality originate from the PSScriptAnalyzer module. PowerShell/vscode-powershell#1385
I would love to see an option to allow alignment of assignmentgroups. Its easiest to show what I mean with an example. (Github wouldn't allow me to format the code manually and trimmed the whitespaces automatically so I had to attach a printscreen).
So that '=' are aligned in columns within a group of assignments. A group could be interpreted as delimitered with a blank line.
The text was updated successfully, but these errors were encountered: