Omnisharp: "no document found" for embedded package files

I’m trying to get unity working with visual studio code for a package that I’ve moved to the Packages directory, but visual studio code refuses to recognize that the files in the package are files that it should know about and produce an outline for. For purposes of creating a minimal project that produces this behavior, I’m using the com.unity.inputsystem package.

To reproduce this, I’m using:

  • unity 2020.3.22f1
  • input system 1.0.2
  • visual studio code 1.64.0
  • C# for Visual Studio Code 1.24.0

First, I create a new 3D project in Unity. I install input system from the package manager. I move the com.unity.inputsystem@1.0.2 directory from the package cache to the packages directory. Unity preferences looks like this:

I click “regenerate project files”. I open inputsystem.cs like this:

It opens in visual studio code, but when I look at the omnisharp log, it gives me the subject error:

However, InputSystem.cs is in a compile include in Unity.InputSystem.csproj, which is included in the active solution in visual studio code. I’m expecting it to fill out the outline pane but it does not. What gives?

Cross posted to the omnisharp GitHub page and found the solution: "No symbols found in document" for listed file in project · Issue #5051 · dotnet/vscode-csharp · GitHub.