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

Console crash when pasting parameter #1675

Closed
ili101 opened this issue Dec 27, 2018 · 6 comments
Closed

Console crash when pasting parameter #1675

ili101 opened this issue Dec 27, 2018 · 6 comments

Comments

@ili101
Copy link

ili101 commented Dec 27, 2018

Issue Type: Bug

  1. Create a new Untitled-1 Doc (PowerShell)
  2. paste this code
function Test-Params
{
    Param(
        $Param1,
        $Param2
    )
}
Test-Params -Param1
  1. Copy "Param2"
  2. paste it over "Param1" (in the line Test-Params -Param1)
    (if it's not crashing the first time repeat with "Param2")
  3. crash...

error

Extension version: 1.10.2
VS Code version: Code 1.30.1 (dea8705087adb1b5e5ae1d9123278e178656186a, 2018-12-18T18:12:07.165Z)
OS version: Windows_NT x64 10.0.17134

EditorServices.log

System Info
Item Value
CPUs AMD Ryzen 7 1800X Eight-Core Processor (16 x 3593)
GPU Status 2d_canvas: enabled
checker_imaging: disabled_off
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: disabled_software
rasterization: enabled
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
Memory (System) 15.95GB (8.26GB free)
Process Argv
Screen Reader no
VM 0%
@autosvet
Copy link

I can confirm the same behaviour with PS Core 6.1.0 and 6.1.1.

PS Extension version: 1.10.2
VSCode 1.30.1

@rkeithhill
Copy link
Contributor

Thanks for submitting this. I have a fix I'll be submitting shortly. It might be a few weeks until there is a release though. In the meantime, if you don't use an untitled file then you shouldn't run into this bug.

rkeithhill added a commit to PowerShell/PowerShellEditorServices that referenced this issue Dec 28, 2018
This happens because the ScriptFile ctor does not initialize all its
public props.  I added initialization for the other public props
except for the ScriptAst prop.  I don't see an empty Ast.  Perhaps null
is OK for this prop?

This address vscode-powershell bug PowerShell/vscode-powershell#1675

Also, for the 2.0.0 branch, we should see if we can use Array.Empty<>()
for initialization.  It isn't availble to net45x.  :-(
@autosvet
Copy link

Thanks Keith.,
The workaround works for me.
Just save the file, even as Untitled-1.ps1 , and the console stops crashing after paste operation.

@rkeithhill
Copy link
Contributor

Yeah, it is not the name per-se, it is that it is an "in-memory" document with no file backing it.

@rkeithhill
Copy link
Contributor

rkeithhill commented Jan 20, 2019

I believe this bug to be fixed by the PR referenced above. The fix should be available in 1.11.0. Should we wait for confirmation of the fix before closing this?

@rkeithhill
Copy link
Contributor

I'm closing this since we believe it to be fixed. @ili101 you can re-open it if you still see this bug with 1.11.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants