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

Crash running formatter on new, untitled document #447

Closed
Jaykul opened this issue Jan 19, 2017 · 1 comment
Closed

Crash running formatter on new, untitled document #447

Jaykul opened this issue Jan 19, 2017 · 1 comment
Assignees
Labels
Issue-Bug A bug to squash.
Milestone

Comments

@Jaykul
Copy link

Jaykul commented Jan 19, 2017

Please fill in these details so that we can help you!

System Details

  • Operating system name and version:
    Windows 10 AU
  • VS Code version:
    1.9.0-Insider
  • PowerShell extension version:
    0.9.0
  • Output from $PSVersionTable:
Name                           Value
----                           -----
PSVersion                      5.1.14393.693
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.14393.693
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Issue Description

Crash when calling format document on a new unsaved document.

Steps to repro

Create a New File
Set the Syntax to PowerShell
Write something in it, like

foreach($thing in $list){$result=Get-Thing $thing}

Then hit "Format Document" (e.g. alt+shift+f)

Attached Logs

1484856115-dfce8230-a989-4c8e-85bd-d9a055a6031d1484856005946.zip

@daviwil daviwil added the Issue-Bug A bug to squash. label Jan 19, 2017
@daviwil daviwil added this to the 0.9.1 milestone Jan 19, 2017
@daviwil
Copy link
Contributor

daviwil commented Jan 19, 2017

This is happening for new script files that haven't been saved yet, they are still marked as "Untitled". If you create a new file, paste in Joel's example script, click the file type selector in the status bar and turn it to PowerShell then hit Shift+Alt+F, you'll see the crash. Here's the exception from the logs:

System.IO.FileNotFoundException: Could not find file 'C:\Program Files (x86)\Microsoft VS Code Insiders\Untitled-1'

We basically just need to handle untitled files correctly.

/cc @kapilmb

@daviwil daviwil changed the title Crash running formatter on "new document" Crash running formatter on new, untitled document Jan 19, 2017
@kapilmb kapilmb self-assigned this Jan 19, 2017
@daviwil daviwil modified the milestones: 0.9.1, 0.10.0 Mar 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug A bug to squash.
Projects
None yet
Development

No branches or pull requests

3 participants