Skip to content
This repository was archived by the owner on Dec 8, 2021. It is now read-only.

Add initial pretty printer prototype #64

Open
wants to merge 17 commits into
base: master
Choose a base branch
from

Conversation

rjmholt
Copy link
Contributor

@rjmholt rjmholt commented Mar 19, 2020

No description provided.

@JustinGrote
Copy link

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.

@rjmholt
Copy link
Contributor Author

rjmholt commented Mar 19, 2020

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants