Skip to content
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

Code formatting preset - Add ability to override settings set by preset #5109

Open
2 tasks done
o-l-a-v opened this issue Dec 1, 2024 · 2 comments
Open
2 tasks done
Labels
Issue-Enhancement A feature request (enhancement). Up for Grabs Will shepherd PRs.

Comments

@o-l-a-v
Copy link
Contributor

o-l-a-v commented Dec 1, 2024

Prerequisites

  • I have written a descriptive issue title.
  • I have searched all issues to ensure it has not already been reported.

Summary

A lot of people including me like OTBS with else on a new line.

To achieve this with vscode-powershell one have to use "powershell.codeFormatting.preset": "Custom" and set all formatting rules one by one.

It'd be nice with the ability to override any setting set by a preset. If this is not possible or feasible maybe a new preset can be added to PSScriptAnalyzer:

Proposed Design

No response

@o-l-a-v o-l-a-v added Issue-Enhancement A feature request (enhancement). Needs: Triage Maintainer attention needed! labels Dec 1, 2024
@andyleejordan andyleejordan added Up for Grabs Will shepherd PRs. and removed Needs: Triage Maintainer attention needed! labels Dec 3, 2024
@andyleejordan
Copy link
Member

Ah I see what you mean, I'll mark this as Up For Grabs. I'd take a PR if it can do this reasonably suscinctly.

@JustinGrote
Copy link
Collaborator

JustinGrote commented Dec 3, 2024

These "presets" are a PSES concept and not a scriptanalyzer concept. They are defined here:
https://github.com/PowerShell/PowerShellEditorServices/blob/42d13997e346de4601a08b7ab04a5207656ae1dd/src/PowerShellEditorServices/Services/Workspace/LanguageServerSettings.cs#L218-L247

So a PR could be fairly straightforward to just add a new entry to the enum with the appropriate settings. Changing the switch to an exhausive pattern matching would also help catch any net-new issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Enhancement A feature request (enhancement). Up for Grabs Will shepherd PRs.
Projects
None yet
Development

No branches or pull requests

3 participants