Modules icon indicating copy to clipboard operation
Modules copied to clipboard

Add initial pretty printer prototype

Open rjmholt opened this issue 4 years ago • 2 comments

rjmholt avatar Mar 19 '20 18:03 rjmholt

Nice! An AST-based formatter has been a long time coming.

My list of asks over what vscode-powershell currently does:

  1. Fix parameter casing and parameter shorthands
  2. Maybe downcompatible support as an option? e.g. if I use || and I'm set to 5.1 or 6 compatibility, convert it to an equivalent PS5.1 if/then.
  3. Shorthand .NET type references if an equivalent using namespace is present.
  4. Similar to 3, with a setting, enable "compressing" type references and sticking an equivalent using namespace at the top.

JustinGrote avatar Mar 19 '20 19:03 JustinGrote

My list of asks over what vscode-powershell currently does:

After writing this tool, it's likely that this pretty printer won't suit those needs, because it prints purely based on the AST and will lose things the AST doesn't capture. Try this printer out on a long script with comments in it for example.

It might be better to register your requests in the PSSA repo, where the current formatter implementation lives. I don't think we'll be able to track them easily here

rjmholt avatar Mar 19 '20 20:03 rjmholt