Vscode-powershell: Powershell Code Formatter not working

Created on 24 Apr 2019  路  6Comments  路  Source: PowerShell/vscode-powershell

System Details


System Details Output

PS C:\code\remote-vscode-workspace> & {"### VSCode version: $(code -v)"; "`n### VSCode extensions:`n$(code --list-extensions --show-versions | Out-String)"; "`n### PSES version: $($pseditor.EditorServicesVersion)"; "`n### PowerShell version:`n$($PSVersionTable | Out-String)"}
### VSCode version: 1.33.1 51b0b28134d51361cf996d2f0a1c698247aeabd8 x64

### VSCode extensions:
[email protected]
[email protected]


### PSES version: 1.12.1.0

### PowerShell version:

Name                           Value
----                           -----
PSVersion                      5.1.17134.590
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.17134.590
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Issue Description

When I try to run the formatter on a .ps1 file, using either Alt-Shift-F or selecting format document from the command palette, I get the error message: "There is no formatter for "powershell"-files installed"

Expected Behaviour

I would expect the document to be formatted, I know I have some inconsistencies

Actual Behaviour

I get the error message: "There is no formatter for "powershell"-files installed"
image

Attached Logs

Follow the instructions in the troubleshooting docs
about capturing and sending logs.
ps-ext-logs.zip

Area-Code Formatting Needs-Repro-Info

Most helpful comment

The new remoting tools provided in Code Insiders fixes all of my issues

All 6 comments

I may have just figured this out...it doesn't work for files using the remote file system component of visual studio. It seems to work fine on files in a local directory (other files are using SSH FS)

@derekslenk when you say:

it doesn't work for files using the remote file system component of visual studio

Is that some type of UNC path or are you using PowerShell remoting? Sorry I need more context with this.

@derekslenk I'm assuming you mean this isn't working with files made available in VSCode via the SSHFS extension?

Without any details about how that extension works, I don't think we can support it. If it's not transparent under the VSCode workspace APIs then we'd have to implement special logic for this extension.

If you have a way of actually mounting an SSHFS onto the filesystem itself in Windows, that would probably work better

Closing this issue as inactive, will re-open with more information....might also be worth looking into VSCode's new remoting extension as this may solve some of the challenges here.

The new remoting tools provided in Code Insiders fixes all of my issues

Was this page helpful?
0 / 5 - 0 ratings