vscode: Code lens get randomly bungled in the latest stable, "actual command NOT FOUND" error on click

  • VSCode Version: 1.44.2
  • OS Version: Win10

This looks like the same issue as locked&closed https://github.com/microsoft/vscode/issues/84153. I think I’ve found a simple and reliable repro so I suggest that issue to be reopened.

Repro steps: 1: Make basic HelloWorld c# program with “dotnet new console”. Add test class like in the gif to have some densely packed code lens. 2. Move/delete/enter multiple lines at the same time. 3. Result: code lens get mixed up, and clicking on the bungled ones result in actual command NOT FOUND errors

Here is a visual demonstration:

codelensbug

It’s broken whenever number of references doesn’t match the field name. It frequently gets bungled and un-bungled on every change, so it’s likely some racing-conditions are going on.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 1
  • Comments: 15 (6 by maintainers)

Commits related to this issue

Most upvoted comments

Thanks @SirIntruder. I can reproduce and I believe I know what’s happening here: Code lens works in two phases.

  1. First we ask about all potential code lens places and
  2. second we ask to resolve those places (for visible places which repeats when scrolling etc).

Whenever you type we start again but there is also code to resolve new places when typing, e.g when removing a large block of text which then reveals new, unresolved places. The problem is that the resolve call isn’t valid because the positions of the original lenses have changed. Another problem is that the resolve-after-type races against the resolve-after-places.