Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Intellisense not working for Visual Studio Code

Discussion in 'Code Editors & IDEs' started by stpaulgym, Jan 19, 2020.

  1. Allennick

    Allennick

    Joined:
    May 22, 2020
    Posts:
    3
    This worked for me. Cheers mate
     
  2. nomix123

    nomix123

    Joined:
    Oct 29, 2021
    Posts:
    1
    You don't have to uninstall anything just follow these steps and everything will be fine:

    1. Close the Visual Studio.
    2. Open the unity Preferences from the toolbar and select the external tools.
    3. Then, External Script Editor chose (Open the file by extension) and instantly changed it to visual studio.
    4. Open your code file IntelliSense will work.
     
  3. The_Dark_Swordsman

    The_Dark_Swordsman

    Joined:
    May 16, 2020
    Posts:
    6
    This worked perfectly for me. Thank you!
     
  4. MIMI2020

    MIMI2020

    Joined:
    Oct 26, 2022
    Posts:
    1
    thank you this works perfectly
     
  5. MatiazTrote

    MatiazTrote

    Joined:
    Nov 5, 2022
    Posts:
    1
    Hello, I'm a begginer and had the same problem. What has worked for me was to:
    1. Install the C# plugin by Microsoft in VSCode.
    2. Close VSCode.
    3. In Unity, go to Assets>Open C# Project.
    After that, it opened the project in VSCode (if you have it configured in your preferences), and Intelisense started helping.

    Ex:
    Input.GetKeyDown(KeyCode. >> should give you a list of keyboard inputs.

    Simple, but maybe U don't have C# installed in your VSCode. :p

    Thank you!
    This is my first interaction in the Unity Forum!
    <3
     
    Last edited: Dec 1, 2022
  6. vijay_vardan

    vijay_vardan

    Joined:
    Dec 10, 2022
    Posts:
    3
     
  7. vijay_vardan

    vijay_vardan

    Joined:
    Dec 10, 2022
    Posts:
    3
    refer this video... This will damn sure help you!... and good luck
     
    tantx and sqwirral like this.
  8. seeeking

    seeeking

    Joined:
    Jul 31, 2015
    Posts:
    1
    In my case, disabling and enabling back C# by OmniSharp extension worked, maybe it'll help somebody.
     
  9. MurphMuffin3551

    MurphMuffin3551

    Joined:
    Nov 30, 2022
    Posts:
    1
    You are such a legend
     
    IvanRoyLoewen likes this.
  10. IvanRoyLoewen

    IvanRoyLoewen

    Joined:
    Apr 19, 2016
    Posts:
    3
    You're not wrong, that was so easy. Thanks!
     
  11. Deleted User

    Deleted User

    Guest

    I already have it and it still doesn't work
     
  12. Toonda_Byood

    Toonda_Byood

    Joined:
    Apr 26, 2014
    Posts:
    2
    how I got intellisense working on Fedora 37:

    firstly, when it wasn't working:
    already had VS Code installed from official source (from Microsoft repository). installed dotnet 7, mono-devel and mono-complete, but had no auto-completion and kept getting a message in VS Code that I don't have MSBuild from Mono. useModernNet was false, and my mono path was set.

    what i did to get it to work:
    sudo dnf remove mono-complete
    sudo dnf remove mono-devel (i had both installed and had to remove both individually)
    sudo dnf remove dotnet-sdk-7.0

    sudo dnf install mono-complete
    sudo dnf install dotnet-sdk-6.0
    in VS Code, install the older version 1.24.4 of C# (I had the newest version, a 1.25, and clicked the circle/settings to downgrade). this gives you the "use global mono" option, after restarting VS Code, and set it to always. also set your mono path (in terminal, type: "which mono" and use that output), and useModernNet to false.

    unfortunately, I had to start a brand new project as the old one still didn't intellisense (haven't consulted my magic 8 ball yet as to why, but who the heck knows, "Regenerate project files" in External Tools didn't seem to work), but a new project worked fine (just give VS Code a minute to get going after start up).
     
    Last edited: Apr 4, 2023
  13. TheSleepyKoala

    TheSleepyKoala

    Joined:
    Aug 24, 2018
    Posts:
    23
    Hey there!

    If it's not too much trouble, can you test if my package for VSCode helps solve your issue for Fedora 37?
    https://github.com/Chizaruu/com.tsk.ide.vscode

    It uses the more modern features of Omnisharp, so I'm hoping it helps solve your need to downgrade.

    I understand if you don't want to, but if you do and run into any issues, I would appreciate it if you open an issue on the repository. :)
     
  14. valiman

    valiman

    Joined:
    Apr 7, 2023
    Posts:
    1
    works for me when installing ".NET Framework 4.7.1 Developer Pack"

    i use VS Code
     
  15. zezba9000

    zezba9000

    Joined:
    Sep 28, 2010
    Posts:
    983
    VS Code intelesense doesn't work in Ubuntu at all.
    Also when it works in Windows only your main scripts work, no other libraries or packages.

    VS Code is a joke of an IDE for the C# lang.
     
  16. pedronvitoriano

    pedronvitoriano

    Joined:
    Jan 14, 2021
    Posts:
    1
    worked for me, thanks!!
     
  17. ARandomDeveloper222

    ARandomDeveloper222

    Joined:
    Sep 24, 2022
    Posts:
    1
    i spent 1 hour trying to work on auto complete deleting practically everything related to vscode this actually works
     
  18. III111III

    III111III

    Joined:
    Nov 8, 2017
    Posts:
    12
    1) Go to Edit > Preference > External Tools
    2) Change the Externa Script Editor to Visual Studio Code
     
  19. LordDooms

    LordDooms

    Joined:
    Sep 20, 2014
    Posts:
    8
    Maybe this will work for some that find this thread.

    So much life wasted on this. I was having major problems with intellisence when switching projects v 2022.1.2f1. VS Code only seems to work properly if the VS Studio Package (not the VS Code Package) is installed alone.

    Sometimes intellisense worked with old cs files but not new ones.

    In Assembly-CSharp.csproj there is a problem which Framework is getting referenced. This seems to be set by ProjectCache in the Library. VS Code COM is setting to 4.7.1 or to whatever that is not supported or found by VSCode. You can't just edit Assembly-CSharp.csproj because it is updated constantly.

    \Library\PackageCache\come.unity.ide.visualstudio@
    \Library\PackageCache\com.unity.ide.vscode@

    Assembly-CSharp.csproj:
    <TargetFramework>netstandard2.0</TargetFramework> (works)
    vs.
    <TargetFramework>v4.7.1</TargetFramework> (doesn't work)


    1) Make sure Engineering package is uninstalled. You might be able to uninstall the culprit components but untested.
    2) Install VS Code package.
    3) Install VS Studio package.
    4) Uninstall VS Code package.
    5) Select VS Code in Preferences. (for whatever reason it sticks even though VS Code package is uninstalled)
    6) Select .netstandard in project settings player...
     
    tantx likes this.