question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Plus in String get's removed

See original GitHub issue

System Details

System Details Output

VSCode version: 1.50.1 d2e414d9e4239a252d1ab117bd7067f125afd80a x64

VSCode extensions:

donjayamanne.githistory@0.6.12 eamodio.gitlens@10.2.2 ecmel.vscode-html-css@0.2.3 formulahendry.terminal@0.0.10 huizhou.githd@2.2.4 justin-grote.better-powershell-syntax-highlighting@0.0.2 MamoruDS.workspace-cacheclean@0.0.2 ms-mssql.mssql@1.9.0 ms-vscode-remote.remote-wsl@0.50.1 ms-vscode.powershell@2020.6.0 streetsidesoftware.code-spell-checker@1.9.2 streetsidesoftware.code-spell-checker-hebrew@0.1.4 techer.open-in-browser@2.0.0 Tyriar.shell-launcher@0.4.1 Tyriar.terminal-tabs@0.2.0 vscode-icons-team.vscode-icons@11.0.0 Zignd.html-css-class-completion@1.19.0

PSES version: 2.2.0.0

PowerShell version:

Name                           Value
----                           -----
PSVersion                      7.0.3
PSEdition                      Core
GitCommitId                    7.0.3
OS                             Microsoft Windows 10.0.19041
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Issue Description

I have a module where i pass a string parameter like this: -Message (“We retrieved " + $comps.count + " computers from AD”) }

What VS Code does when auto-formatting is change the sentence to: -Message (“We retrieved " $comps.count + " computers from AD”)

Note the first plus in the sentence was removed.

In the problems window I get this: image

But the code runs just fine.

And I can’t even run the code without saving, since it’s changes the code and then messes everything up.

Expected Behaviour

This code worked fine in previous versions of VSCode. Something changed, although not sure what.

Actual Behaviour

– Description of what actually happens –

Attached Logs

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

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
reuvygroovycommented, Oct 28, 2020

I updated but I still got the message in PowerShell 7 using a regular shell, outside of VSCode. image

0reactions
bergmeistercommented, Oct 29, 2020

Great to hear that. The PowerShell extension ships a backup of the PSSA module in case the user does not have it installed. Right now the stable extension still ships 1.19.0 unfortunately as it hasn’t released an update for a while but the preview extension already ships 1.19.1. Therefore by installing the latest version, you’ve fixed the issue. You can always periodically run the install command but otherwise you are at the mercy of the PowerShell extension updating the pssa module in time. Some of this is by design to limit the blast radius in case a serious bug got found in a new pssa release. Cc @SydneyhSmith

Read more comments on GitHub >

github_iconTop Results From Across the Web

Remove plus sign (+) in URL query string - javascript
Remove plus sign (+) in URL query string · 1. str. · 6. decodeURIComponent("Is+it+friday+the+13th%3F"). · Possible duplicate of Replacing all plus ...
Read more >
Trimming and Removing Characters from Strings in .NET
String class to remove any number of spaces or other characters ... The trim stops when a character not specified in the array...
Read more >
Using sed to remove digits and white space from a string
A sed -r 's/^[0-9]+\.[0-9]+ //' input should do, if you copy whatever is the space between your numbers and the string into the...
Read more >
Removing plus signs from URL query string - Javascript
I'm trying to use the String Object's replace() method to accomplish this. This is what I've tried so far along with the results:...
Read more >
Google Sheets: remove the same text or certain characters ...
Remove the first/last N characters from strings in Google Sheets · Use REGEXREPLACE. · RIGHT/LEFT+LEN also count the number of characters to ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found