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.

autoCorrectAliases replaces "process {" with "Get-Process {"

See original GitHub issue

Issue Type: Bug

Hello,

first, I don’t know whether this setting is due to the Extension or VsCode itself. Please advise if this needs to be raised in the VsCode repo.

This issue does not occur with the default setting for Auto-Correcting Aliases:

 // Replaces aliases with their aliased name.
 "powershell.codeFormatting.autoCorrectAliases": false,

I have autoCorrectAliases set to TRUE and I love this feature 😃

This happens under very specific circumstances, i.E. when code-Errors are present.

I have an advanced script with BEGIN/PROCESS/END block and during changing the description of a Parameter for example, the syntax is incomplete resulting in the code being read differently (usually this is an open comment with ’ or " (when replacing them with the other or adding emphasis within the comment).

my process block function name gets replaced with Get-Process resulting the whole Script to be unusable.

❯ Get-Alias process
Get-Alias : This command cannot find a matching alias because an alias with the name 'process' does not exist.
At line:1 char:1
+ Get-Alias process
+ ~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (process:String) [Get-Alias], ItemNotFoundException
    + FullyQualifiedErrorId : ItemNotFoundException,Microsoft.PowerShell.Commands.GetAliasCommand

Process.exe is an executable, but no substitute for Get-Process…

Can this replacement please be excluded?

Extension version: 2021.2.1 VS Code version: Code 1.54.3 (2b9aebd5354a3629c3aba0a5f5df49f43d6689f8, 2021-03-15T10:55:45.459Z) OS version: Windows_NT x64 10.0.19042

System Info
Item Value
CPUs Intel® Core™ i7-9700K CPU @ 3.60GHz (8 x 3600)
GPU Status 2d_canvas: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
protected_video_decode: unavailable_off
rasterization: enabled
skia_renderer: enabled_on
video_decode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 31.87GB (17.19GB free)
Process Argv –crash-reporter-id efc3d77d-4b9d-44d6-894f-bd5aee3260eb
Screen Reader no
VM 0%
A/B Experiments
vsliv368cf:30146710
vsreu685:30147344
python383cf:30185419
vspyt653:30270858
vspor879:30202332
vspor708:30202333
vspor363:30204092
vstry914:30276682
pythonvsdeb440:30248342
pythonvsded773:30248341
pythonvspyt875:30259475
pythonvsnew554cf:30280384
pythontbcf:30265426
pythonvspyt943cf:30280190
openwsldoc:30280162
vscoresta800cf:30279782
vspre833:30267464
pythonptprofiler:30281270
vshan820:30276952

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
DEberhardtcommented, Sep 14, 2021

More like, “Shaka. When the bug is squashed” 😸

1reaction
andschwacommented, Sep 14, 2021

Shaka. When the walls fell. 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

"Auto correct alias" setting of PowerShell extension not working
Nothing happens. The aliases are still reported as problems and are not being replaces with the correct expanded Cmdlet. Environment Information.
Read more >
Managing processes with Process cmdlets - PowerShell
You can get particular processes by specifying their process names or process IDs. The following command gets the Idle process: PowerShell
Read more >
Word XP: Use AutoCorrect and Find and Replace - GCF Global
Using Find and Replace to replace "Word 2000" with "Word XP" will save you time and effort in your editing process. Using Find...
Read more >
(Legacy) Microsoft Word 2007: AutoCorrect: Corrections and ...
Automatically use suggestions from the spelling checker, n/a, Works in conjunction with the Replace text as you type option, replacing ...
Read more >
How do I get bash completion for command aliases?
Try complete-alias, which solves this problem exactly. (Disclaimer: I am the author of complete_alias ). After install it you can use one generic...
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