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

Add initial pretty printer prototype #64

Open
wants to merge 17 commits into
base: master
from

Conversation

@rjmholt
Copy link
Member

@rjmholt rjmholt commented Mar 19, 2020

No description provided.

@JustinGrote
Copy link

@JustinGrote JustinGrote commented Mar 19, 2020

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
Member Author

@rjmholt 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 join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.