Search Unity

VS Code doesn't recognize any UI Toolkit types with Unity 2020.2.0b9 and com.unity.ui

Discussion in 'Code Editors & IDEs' started by herra_lehtiniemi, Nov 24, 2020.

  1. herra_lehtiniemi

    herra_lehtiniemi

    Joined:
    Feb 12, 2017
    Posts:
    133
    After installing com.unity.ui and Unity 2020.2.0b9, VS Code (Omnisharp) doesn't recognize any UI Toolkit types anymore. (see attached images).

    Unity doesn't give any compilation errors.

    So far I have tried:
    • Clicking "Regenerate csproj files" in Unity->Project settings->External tools (with all boxes checked)
    • Manually deleting Library-folder and .csproj-files from the project folder
    Here's what the editor says on for example TextField.

    Näyttökuva 2020-11-25 kello 12.04.01.png Näyttökuva 2020-11-24 kello 12.12.52.png

    EDIT: Added another image about the error messages.
     
    Last edited: Nov 25, 2020
  2. griendeau_unity

    griendeau_unity

    Unity Technologies

    Joined:
    Aug 25, 2020
    Posts:
    248
    I had a similar problem yesterday.

    I did exactly that + I invalidated caches for this project in my IDE in order to force it to reload everything. I'm in Rider but VS Code probably has a similar mechanism.
     
  3. herra_lehtiniemi

    herra_lehtiniemi

    Joined:
    Feb 12, 2017
    Posts:
    133
    I tried removing the VS Code cache with
    Code (CSharp):
    1. rm -rf ~/Library/Application\ Support/Code/Cache/*
    2. rm -rf ~/Library/Application\ Support/Code/CachedData/*
    Also deleted the workspace cache with extension "workspace-cacheclean".

    Also tried regenerating csproj files on Unity, clearing the Library and csproj files again manually as well, but I always end up with the previous situation.

    Meanwhile - after installing com.unity.ui, the regular Unity UI package disappeared from Package Manager and doesn't show up in the list. Should it?

    Any other ideas on what to try out or what could cause this?
     
  4. antoine-unity

    antoine-unity

    Unity Technologies

    Joined:
    Sep 10, 2015
    Posts:
    780
    No it shouldn't!

    I am moving this thread to the forum where this is more suitable (External tools), to see if someone else has an idea.
     
  5. herra_lehtiniemi

    herra_lehtiniemi

    Joined:
    Feb 12, 2017
    Posts:
    133
    Update: I installed Visual Studio today (not Code) and the same thing happens there. So it's not VS Code related after all.

    What could this be?

    The elements were recognized with the standard unity.ui (stable), but when I installed the preview version from GitHub, this started.