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.

Full executable paths are stripped on format

See original GitHub issue

System Details

System Details Output

> $PSVersionTable
Name                           Value
----                           -----
PSVersion                      5.1.18362.145
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.18362.145
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Codium version

> codium -v
1.37.0
036a6b1d3ac84e5ca96a17a44e63a87971f8fcc8
x64

Extension version

> codium  --list-extensions --show-versions
...
ms-vscode.powershell@2019.5.0

Editor Services version

> $psEditor.EditorServicesVersion

Major  Minor  Build  Revision
-----  -----  -----  --------
1      12     1      0

Issue Description

This extension is changing lines for me which I do not think should be changed. And the criteria doesn’t make sense. If the full path used exists on the file system, then the path is stripped down to the last element.

Expected Behaviour

Full path to an executable is used in a PowerShell script, and the formatter leaves it be.

Actual Behaviour

Full path to an executable is used in a PowerShell script, and the formatter cuts it down to the last element.

Attached Logs

vscodium-PSextension-logs.zip

Postscript

I think that having an option to disable this functionality would be good. I could not find the rule associated with this formatting in PSScriptAnalyzer.

Along with this, when enabled, full executable paths should always be stripped, not just those whose paths exist on the system.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
TylerLeonhardtcommented, Aug 16, 2019

Ok great - I’ll close this issue since it was related to PSScriptAnalyzer and is fixed in 1.18.1. We should be doing a release of the vscode extension in the next couple weeks which will include a new PSSA.

0reactions
kropptcommented, Aug 16, 2019

Yes, I installed 1.18.1 to fix it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I remove my file paths inside the release version of ...
Build the release and then run strip on the binary. I think that removes all symbols used for backtraces. Joe232 ...
Read more >
PE Format - Win32 apps - Microsoft Learn
The default behavior of the linker is to strip base relocations from executable (EXE) files. IMAGE_FILE_EXECUTABLE_IMAGE, 0x0002, Image only.
Read more >
Find the path of the source code for the executable being ...
You can use the GDB command: info source. Sample output: Current source file is a.c Compilation directory is /home/user/test Located in /home/user/test/a.c ...
Read more >
os.path — Common pathname manipulations — Python 3.11 ...
Normalize a pathname by collapsing redundant separators and up-level references so that A//B , A/B/ , A/./B and A/foo/../B all become A/B ....
Read more >
strip (GNU Binary Utilities) - sourceware.org
GNU strip discards all symbols from object files objfile . The list of object files may include archives. At least one object file...
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