Search Unity

Attempting to Open Scenes or Prefabs Launches VS Code (Unity 2019.2.2f1)

Discussion in 'Editor & General Support' started by StrawberryJellyfish, Aug 24, 2019.

  1. StrawberryJellyfish

    StrawberryJellyfish

    Joined:
    Oct 29, 2016
    Posts:
    23
    Hello Everyone!
    So I've just downloaded Unity 2019.2.2f1 and I opened a new project on my Mac.
    For some reason I can't seem to open prefabs or scenes by double-clicking. Whenever I double click a scene or preview, it just opens Visual Studio Code.

    Does anyone have a fix or some info on this strange behavior?
     
    Last edited: Aug 25, 2019
  2. Shane-Pangea

    Shane-Pangea

    Joined:
    Dec 12, 2012
    Posts:
    38
    I'm having the same issue on my Mac! What is up with that?!
     
  3. Shane-Pangea

    Shane-Pangea

    Joined:
    Dec 12, 2012
    Posts:
    38
    Just is time for my game jam too! :(
     
  4. Shane-Pangea

    Shane-Pangea

    Joined:
    Dec 12, 2012
    Posts:
    38
    @StrawberryJellyfish It seems to just be an issue with VS Code. Within Preferences > External Tools, if I set "External Script Editor" to "Visual Studio" and not "Visual Studio Code", it works fine.
     
  5. apoderechin

    apoderechin

    Joined:
    Oct 22, 2013
    Posts:
    1
    I have the same issue. I also use VS Code. Is there a fix for this?
     
  6. StrawberryJellyfish

    StrawberryJellyfish

    Joined:
    Oct 29, 2016
    Posts:
    23
    Thanks man, I'll try that out (VS Code is my only IDE though, so I suppose it's time to get another :p)
     
  7. dnscotty

    dnscotty

    Joined:
    Jul 12, 2015
    Posts:
    1
    Same issue here, but I don't see an issue with VS Code but instead with Unity. Could be wrong here but I think it's Unity Editor's responsibility to choose what happens when a scene (or whatever file) is double klicked in the assets view.

    I'd say what should be fixed is "what happens when files are double klicked / opened when VS Code is set as editor"?
     
  8. eladleb4

    eladleb4

    Joined:
    Apr 25, 2016
    Posts:
    57
    Using Unity's package manager I updated to vscode plugin version 1.1.0 and it's working correctly.
    HOWEVER...
    Opening a script using double click will no longer open the correct spot in the IDE :(
    Updating to 2019.2 turns out to be quite a terrible experience....
     
    Shane-Pangea likes this.
  9. ExDeaDguY

    ExDeaDguY

    Joined:
    Aug 25, 2009
    Posts:
    503
    I had the same issue. I changed the "External Tools -> External Script Editor" to "Open By File Extension". If you have VSCode set as default program for .cs files you'll be fine from there.

    By doing this you lose the ability to open the entire project in VSCode by default when you dbl click any cs file. But at least it works for now.

    Also - this reveals that the issue lies somewhere with Unity. When windows basic file extensions determines how to load it, it loads fine. When Unity decides how to load scene files (When not using the default Visual Studio) It opens as a script file. Something within Unitys code is indicating when that is triggered in that manner, scene files are script files.

    Fingers crossed for a speedy fix as I do not see myself using anything other than VSCode.
     
    Last edited: Aug 26, 2019
    gear64Studios likes this.
  10. Smolty

    Smolty

    Joined:
    Nov 8, 2016
    Posts:
    17
    Seems to be in Issue specifically with 2019.2.2f1 , don't have this problem with 2019.2.1f.
     
  11. Shane-Pangea

    Shane-Pangea

    Joined:
    Dec 12, 2012
    Posts:
    38
  12. anisabboud

    anisabboud

    Joined:
    Feb 15, 2015
    Posts:
    1
    Thanks Shane-Pangea! Seems fixed now.

    Window -> Package Manager -> Visual Studio Code Editor -> Update to 1.1.0.
     
  13. sk8tyger

    sk8tyger

    Joined:
    Dec 8, 2018
    Posts:
    3
    I can confirm changing the editor to Visual Studio also works in 2019.3.0 beta
     
  14. illinar

    illinar

    Joined:
    Apr 6, 2011
    Posts:
    863
    Changing the editor to Visual Studio is not a fix thought.

    Updating VSCode package to 1.1.2 worked. Thanks.
     
  15. AkselSky

    AkselSky

    Joined:
    Dec 3, 2015
    Posts:
    11
    Updating VSCode package to 1.1.2 - 100% Fix
    Thanks all
     
  16. fesi

    fesi

    Joined:
    Aug 23, 2017
    Posts:
    1
    I fix this by going in preferences then setting external script editor to open by file extension
     
  17. Whatever560

    Whatever560

    Joined:
    Jan 5, 2016
    Posts:
    513
    This is not a good solution in my case, as it prevents unity to use VS as a build target and projects are not generated when I add new modules.

    So how to stop unity from opening .unity scene files with VS ?