Skip to content

The extension insists on adding the addWhitespaceAroundPipe setting to my workspace settings file #2842

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

Closed
rkeithhill opened this issue Jul 31, 2020 · 15 comments · Fixed by #2863

Comments

@rkeithhill
Copy link
Contributor

System Details

System Details Output

Issue Description

I've had other extensions do this and it is very annoying because it creates unnecessary Git diffs / files committed. Basically when I open a PS1 file in my repo, this change gets made to the workspace's settings.json file:

image

Expected Behaviour

The extensions should never automatically modify my workspace's settings.json file.

Actual Behaviour

The settings.json is being modified behind my back.
vscode-powershell.zip

Attached Logs

Follow the instructions in the troubleshooting docs
about capturing and sending logs.

@ghost ghost added the Needs: Triage Maintainer attention needed! label Jul 31, 2020
@rjmholt
Copy link
Contributor

rjmholt commented Jul 31, 2020

Looks like the test for the deprecated setting isn't specific enough and needs to be modified

@rjmholt
Copy link
Contributor

rjmholt commented Jul 31, 2020

Here's the relevant change: #2830

@TylerLeonhardt
Copy link
Member

cc @bergmeister

@bergmeister
Copy link
Contributor

bergmeister commented Jul 31, 2020

@rkeithhill Have you got the whitespaceAroundPipe setting defined somewhere (user or workspace scope?).
Because the code is there to move the setting from the deprecated no-op whitespaceAroundPipe setting to the new addWhitespaceAroundPipe.

@rkeithhill
Copy link
Contributor Author

It's not in my user settings. Here are all the user settings I have defined for PowerShell:

    "powershell.codeFolding.showLastLine": false,
    "powershell.codeFormatting.preset": "Stroustrup",
    "powershell.debugging.createTemporaryIntegratedConsole": false,
    "powershell.developer.editorServicesLogLevel": "Diagnostic",
    "powershell.developer.editorServicesWaitForDebugger": false,
    "powershell.enableProfileLoading": true,
    "powershell.integratedConsole.focusConsoleOnExecute": true,
    "powershell.integratedConsole.showOnStartup": true,
    "powershell.powerShellDefaultVersion": "PowerShell Preview (x64)",
    "powershell.scriptAnalysis.enable": true,
    "powershell.sideBar.CommandExplorerVisibility": false,
    "powershell.useX86Host": false,

There are no PowerShell settings in the workspace settings:
image

@PrzemyslawKlys
Copy link
Contributor

PrzemyslawKlys commented Jul 31, 2020

I have same problem:

image

It keeps on adding it.

image

If i delete the file

image

But later on extension will again "fix it".

image

@ili101
Copy link

ili101 commented Aug 3, 2020

Same here
+1

@JustinGrote
Copy link
Collaborator

For me its also injecting into my workspace settings, not just user settings.

@SydneyhSmith SydneyhSmith added Area-Configuration Area-Workspaces Issue-Bug A bug to squash. and removed Needs: Triage Maintainer attention needed! labels Aug 4, 2020
@TylerLeonhardt
Copy link
Member

Looks like no matter what, configuration.has(deprecatedSetting) is true.

if (configuration.has(deprecatedSetting) && configurationTargetOfNewSetting === null) {

@TylerLeonhardt
Copy link
Member

I've got a fix out for this.

@bergmeister
Copy link
Contributor

Sorry, I was quite busy the last days, thanks for fixing it. When I was testing it, the debug instance of VS-Code did not have a workspace open with .vscode folder, hence why I did not notice this when testing. I am surprised this is coming up only now since the migration of the old setting to the new setting has been in the preview for a few months now, the last preview only tweaked the behaviour to additionally remove the old setting.

@ghost ghost added the Needs: Maintainer Attention Maintainer attention needed! label Aug 5, 2020
@TylerLeonhardt
Copy link
Member

No worries!

@TylerLeonhardt TylerLeonhardt removed the Needs: Maintainer Attention Maintainer attention needed! label Aug 5, 2020
@AArnott
Copy link

AArnott commented Oct 31, 2020

I'm still seeing this behavior. What version of the extension has the fix?

Apparently I have two potentially relevant extensions installed:
image

@ghost ghost added the Needs: Maintainer Attention Maintainer attention needed! label Oct 31, 2020
@JustinGrote
Copy link
Collaborator

@AArnott you need to have either Powershell or Powershell Preview installed, not both. It should actually be warning you not to do this and to uninstall one every startup.

@AArnott
Copy link

AArnott commented Oct 31, 2020

It should actually be warning you not to do this and to uninstall one every startup.

Hmm... well I never noticed the warning. Till now. I removed the Preview one and restarted. So far, no settings.json change. :)

@SydneyhSmith SydneyhSmith removed the Needs: Maintainer Attention Maintainer attention needed! label Dec 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants