VS Code editor intellisense doesn't work with UnityEngine.UIElements namespace

Viewed 259

I can't get any types under UIElements to be picked up by Omnisharp when using VS Code or Vim. I've tried with a minimal project (clean 3d template) with Unity version 2020.3.20f1, Visual Studio Code Editor (Unity package) version 1.2.4, UI Toolkit version 1.0.0-preview.18. I've followed the guide here to get the correct compilation order of packages.

Build still works fine, but the editor's intellisense throws squiggles under all UIElements types (e.g. VisualElement, UIDocument).

2 Answers

Change the external script editor (Preferences > External Tools) from Visual Studio Code to Visual Studio Community 2019, then regenerate project files. This seems to work around whatever the issue with Unity is.

Downgrade to Visual Studio Code Editor v1.2.3. I have the same issue with .4

Related