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

Stopping formatting from resolving pathexec #2104

Closed
boenrobot opened this issue Jul 26, 2019 · 1 comment
Closed

Stopping formatting from resolving pathexec #2104

boenrobot opened this issue Jul 26, 2019 · 1 comment

Comments

@boenrobot
Copy link

boenrobot commented Jul 26, 2019

Issue Description

If I have a command that can be resolved to an .exe or .cmd or another PATHEXT extension, formatting the document adds the extension to it.

e.g.

node --version

becomes

node.exe --version

I would like to be able to stop this from happening somehow.

Why would this be a problem if it's accurate you may ask? Because I'm trying to write a PowerShell script that would be ran via PowerShell core on Linux, where "node" is just "node", not "node.exe". That same script is also compatible with Windows and PowerShell 5.1, but to achieve the cross platform compatibility, the extensions are intentionally removed.

Environment Information

Visual Studio Code

Name Version
Operating System Windows_NT x64 10.0.18362
VSCode 1.36.1
PowerShell Extension Version 2019.5.0

PowerShell Information

Name Value
PSVersion 5.1.18362.145
PSEdition Desktop
PSCompatibleVersions 1.0 2.0 3.0 4.0 5.0 5.1.18362.145
BuildVersion 10.0.18362.145
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

Visual Studio Code Extensions

Visual Studio Code Extensions(Click to Expand)
Extension Author Version
code-groovy marlon407 0.1.2
EditorConfig EditorConfig 0.13.0
gradle-language naco-siren 0.2.3
jenkinsfile-support ivory-lab 0.4.4
mysql-syntax jakebathman 1.3.1
php-debug felixfbecker 1.13.0
php-intellisense felixfbecker 2.3.10
powershell ms-vscode 2019.5.0
prettier-vscode esbenp 1.9.0
vscode-apache mrmlnc 1.2.0
vsliveshare ms-vsliveshare 1.0.581
@rjmholt
Copy link
Contributor

rjmholt commented Jul 26, 2019

In fact this is fixed by PSScriptAnalyzer 1.18.1 already: PowerShell/PSScriptAnalyzer#1210 (comment).

If you run Install-Module PSScriptAnalyzer -Scope CurrentUser you should override the current version.

We'll also be releasing an update of the extension in the next week or two that includes the updated PSScriptAnalyzer dependency.

@rjmholt rjmholt closed this as completed Jul 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants