Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Not autocomplete/Intellisense on VSCode with Unity 2019.3.0a8

Discussion in 'Editor & General Support' started by Zaine7673, Dec 3, 2019.

  1. Zaine7673

    Zaine7673

    Joined:
    Feb 15, 2018
    Posts:
    238
    I'm having some really strange issues with auto-complete on VSCode on unity.

    It works on some older projects but does not work on any projects regardless of what version of unity the new project is on.

    I've tried everything.Went through the forum and re-installed VSCode, installed Mono (Though I'm on windows), installed everything from https://code.visualstudio.com/docs/other/unity, tried opening folder from VSCode and tried right clicking the script then "open c# project" and nothing works.

    I don't understand as it worked 2 months ago when i used it.

    I am currently using Visual Studio Community but it's now saying that My trial is about to expire :-( and I prefer VSCode.

    Is anyone from Unity able to support me with this? please.
     
    Carrotpie likes this.
  2. Zaine7673

    Zaine7673

    Joined:
    Feb 15, 2018
    Posts:
    238
    nobody from Unity can tell me why VSCode Intellisense wont work with Unity anymore?
     
  3. Nullmind

    Nullmind

    Joined:
    Sep 29, 2015
    Posts:
    25
    Same. Just updated to 2019.3 and intellisense is not working at all.
    Also the namespaces are messed up for me.
     
    Carrotpie likes this.
  4. Zaine7673

    Zaine7673

    Joined:
    Feb 15, 2018
    Posts:
    238
    2 months later and there is still no solution for this....

    Every time i update unity, a massive headache is involved.
     
    GoranRiddle, Nullmind and Carrotpie like this.
  5. Monsterwald

    Monsterwald

    Joined:
    Jan 19, 2020
    Posts:
    68
    Still an issue, no auto complete -.- what an unusable garbage this new 2019.03 version
     
    Zaine7673 likes this.
  6. bitinn

    bitinn

    Joined:
    Aug 20, 2016
    Posts:
    961
    Assuming you have setup everything else correctly:

    - Delete all your .csproj and .sln in project folder
    - Create a new script in Unity, to force it to regenerate these files again
    - Reload your project in vs code.
    - See if it fixes your issue, it did for me.
     
  7. andywatts

    andywatts

    Joined:
    Sep 19, 2015
    Posts:
    110
    Recreating sln to include csproj assembly worked for me.
    Delete the files if you have them and temporarily set the editor to "Visual Studio".
    The editor shows checkboxes to generate csproj and add to sln.
    This is within Unity -> Preferences -> External Tools.
     
    Tyno80 likes this.
  8. Cardinal90

    Cardinal90

    Joined:
    Aug 9, 2017
    Posts:
    15
    Reverting the "Visual Studio Code Editor" package from 1.1.4 to 1.1.3 fixed the issue for me.
     
  9. wmjoers

    wmjoers

    Joined:
    Jan 4, 2020
    Posts:
    3
    How did you do that?

    Edit:
    Just found it! :) And it worked for me!
    And for others that's also new to Unity you find it by opening the Window menu and select Package Manager. Then you should see the package Visual Studio Code Editor package with version 1.1.4 installed. Click on the arrow to the left and select "See all versions". Select the 1.1.3 version and click on the button "Update to 1.1.3" in the lower right corner of the dialog.
     
    Last edited: Feb 7, 2020
    TechRoxx5, Rughnar and angel1st like this.
  10. haim96

    haim96

    Joined:
    May 24, 2013
    Posts:
    107
    yap, that solve the issue for me too. but every time i upgrade unity i have issues with vs code. unity should solved that for good!
     
  11. Rughnar

    Rughnar

    Joined:
    Apr 10, 2020
    Posts:
    1
    This worked for me too, thanks!
     
    Deleted User likes this.
  12. mbry0nic

    mbry0nic

    Joined:
    Apr 18, 2020
    Posts:
    1
    This essentially worked for me, as well. I was on VSCode Editor 1.2.0, reverted to 1.1.3, which did not fix it, but then returned to 1.2.0, which fixed it.

    I believe removing and reimporting 1.2.0 also would have resolved it.
     
  13. rbisso

    rbisso

    Joined:
    Jul 13, 2011
    Posts:
    29
    Thank you so much, this solution worked! I hope they smooth this out in an upcoming release.
     
  14. RickardV

    RickardV

    Joined:
    Sep 20, 2020
    Posts:
    3
    Thank you!
     
  15. Visuallization

    Visuallization

    Joined:
    Mar 14, 2015
    Posts:
    8
    Switching the editor in preferences to Visual Studio and then switching it back to Visual Studio Code, also worked for me.

    Switch to Visual Studio.
    Go to: `Edit -> Preferences -> External tools -> External Script Editor -> set it to Visual Studio.`
    Open a Script in Visual Studio.

    Then switch it back to Visual Studio Code.
    Go to: `Edit -> Preferences -> External tools -> External Script Editor -> set it to Visual Studio Code.`
    Open a script in Visual Studio Code. See it works.

    Maybe it is not even necessary to reopen the scripts and the editor switch will just do the trick.
     
    jaywebb2 likes this.
  16. nextbaws_unity

    nextbaws_unity

    Joined:
    Jan 29, 2018
    Posts:
    2
    To get code hinting working correctly I had to update the vs code C# plugin "Use global mono" from "Auto" to "Always"

    View attachment 841837

    Hope this helps
     
    tcevik, kolmerg, Jerse1 and 2 others like this.
  17. RonaldTR

    RonaldTR

    Joined:
    May 11, 2021
    Posts:
    1
    Blessed answer! Did solve my problem!!!
     
  18. fizzyfrosty

    fizzyfrosty

    Joined:
    Mar 3, 2016
    Posts:
    18
    Perfect!! Autocomplete working now!
     
  19. Jerse1

    Jerse1

    Joined:
    May 17, 2021
    Posts:
    1
    Thanks! That fixed it for me
     
  20. kainthekiller

    kainthekiller

    Joined:
    Aug 20, 2019
    Posts:
    1
    still helping :D
     
  21. kylefoley

    kylefoley

    Joined:
    Mar 9, 2017
    Posts:
    1
    @kainthekiller Worked for me too, you just fixed months of headaches
     
  22. Mosaab_matar

    Mosaab_matar

    Joined:
    Dec 11, 2021
    Posts:
    1
    Still Having This Awkward Problem
     
  23. unity_D6D54C47B612BBADA995

    unity_D6D54C47B612BBADA995

    Joined:
    Aug 4, 2021
    Posts:
    1
    Try "omnisharp.useGlobalMono": "always" in Visual Studio Code settings.json

    upload_2022-1-11_16-52-5.png
     
  24. Pixelated_Lagg

    Pixelated_Lagg

    Joined:
    Jan 23, 2021
    Posts:
    35
    Is the Mono fix exclusive to MacOS? I saw some dude say it only applies to Mac and Windows users only need .NET Framework (which I have installed), yet intellisense still does not work.
     
  25. SpeziFischDE

    SpeziFischDE

    Joined:
    Jan 7, 2019
    Posts:
    1
    Updating on this: The "Use global mono" setting was removed in version 1.25 of the C# plugin. so you need to revert to a 1.24.x version to still have that option. then this still works.
     
    voidmist likes this.
  26. RW1408

    RW1408

    Joined:
    Jun 23, 2022
    Posts:
    1
    The above setting worked for me. I'm on Visual Studio Code v1.7.1.2 - on Windows, press Ctrl + P to open the action bar, then type in Settings.json, then add the below entry to the JSON:

    Code (CSharp):
    1. "omnisharp.useGlobalMono": "always"
     
  27. MilkMike

    MilkMike

    Joined:
    Jun 28, 2020
    Posts:
    1
    I found an answer for future versions (Like 2021 and onward). You need to make sure the package "Visual Studio Code Editor" is installed and enabled on the project. After that, Go to File -> Preferences -> External Tools. Make sure the Embedded packages and Local packages are enabled and click "regenerate csproj". That should FIx everything
     
    Haxel0rd likes this.
  28. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,520
    This may help you with intellisense and possibly other Visual Studio integration problems:

    Sometimes the fix is as simple as doing Assets -> Open C# Project from Unity. Other times it requires more.

    Other times it requires you also nuke the userprefs and .vsconfig and other crufty low-value high-hassle files that Visual Studio tends to slowly damage over time, then try the above trick.

    Barring all that, move on to other ideas:

    https://forum.unity.com/threads/intellisense-not-working-with-visual-studio-fix.836599/

    Also, try update the VSCode package inside of Unity: Window -> Package Manager -> Search for Visual Studio Code Editor -> Press the Update button

    Also, this: https://forum.unity.com/threads/no-suggestions-in-vscode.955197/#post-6227874
     
    ArchangelRosh likes this.
  29. Andrew_unity

    Andrew_unity

    Joined:
    Dec 18, 2015
    Posts:
    6
    To get Visual Studio Code on Mac working, I used the guide on the Visual Studio site:

    https://code.visualstudio.com/docs/other/unity

    I setup Visual Studio Code as the editor in Unity, deleted the csproj and sln files then run the game to rebuild the files and open a script from Unity, which opens the project folder in Visual Studio Code.

    The main setting that made things work was in Visual Studio Code settings, search for Omnisharp modern and uncheck the box to Use Modern Net. A binary started downloading in the Visual Studio Code terminal.

    All the autocomplete, function definitions, error reporting etc started working after that.

    Opening scripts from Unity can show the error about Mono not being installed. Opening the project directory in Visual Studio Code works and when the project is open, clicking files in Unity will open them in the existing window.
     
    Last edited: Jul 29, 2023