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

Reindent lines breaks here strings #977

Closed
daniel-merchant opened this issue Jul 25, 2017 · 6 comments
Closed

Reindent lines breaks here strings #977

daniel-merchant opened this issue Jul 25, 2017 · 6 comments
Labels
Issue-Bug A bug to squash. Resolution-External Will close automatically.

Comments

@daniel-merchant
Copy link

System Details

  • Operating system name and version: Windows Server 2016
  • VS Code version: 1.15.0-insider
  • PowerShell extension version: 1.4.1
  • Output from $PSVersionTable:
Name                           Value
----                           -----
PSVersion                      5.1.14409.1012
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.14409.1012
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Issue Description

Reindent Lines breaks here-strings

After running Reindent Lines:

function get-test 
{
        write-host @"
        something    
        "@
}

This breaks there here-string as white space is not allowed before the string terminator (which the syntax highlighter correctly points out).
Also you do not usually want additional white space added in the middle of a literal string.
Possibly related to #961

@rkeithhill
Copy link
Contributor

@kapilmb Does the "Reindent Lines" command use the code formatter?

@Eisen-Hardt
Copy link

Same experience for me. I need to remove the indent to make it work properly, which is not my preference when working in a block in which everything else is indented.

@TylerLeonhardt
Copy link
Member

@Eisen-Hardt the ability for "@ to have spaces/tabs in front of it would actually be a PowerShell feature.

Can you open an issue here?

Today, a script wont work properly with anything in front of the closing here string ("@)

@Eisen-Hardt
Copy link

You know, I did just see the same thing in ISE and was thinking maybe this isn't a vscode thing. I will open an issue, thx.

@Eisen-Hardt
Copy link

Looks like there is one open already. PowerShell/PowerShell#2337 (comment)

@JustinGrote
Copy link
Collaborator

@TylerLeonhardt should this be closed as resolution-external or would there potentially be plans to intercept the indentation process and "smart indent" any detected here strings? Seems like that's fraught with issues vs. PowerShell/PowerShell#2337 (comment)

@ghost ghost added the Needs: Maintainer Attention Maintainer attention needed! label Apr 22, 2020
@SydneyhSmith SydneyhSmith added Community-Help Resolution-External Will close automatically. and removed Needs: Maintainer Attention Maintainer attention needed! labels Apr 23, 2020
@ghost ghost closed this as completed Apr 23, 2020
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug A bug to squash. Resolution-External Will close automatically.
Projects
None yet
Development

No branches or pull requests

6 participants