Skip to content

SourceGenerator diagnostics not appearing in error list #49664

@YairHalberstadt

Description

@YairHalberstadt

Version Used: visual studio 16.8.2 and 16.9 preview 1

Intellisense shows members created by the source generator, and you can navigate to the generated code. Building displays the diagnostics. However the diagnostics don't appear in the diagnostics tab when set to show "Intellisense only" diagnostics.

Steps to Reproduce:

  1. Create a new project referencing StrongInject
  2. Add a file:
using StrongInject;
public class Container : IContainer<int> {}
  1. Build, producing this diagnostic:
error SI0102: Error while resolving dependencies for 'int': We have no source for instance of type 'int'
  1. Navigate to the location of the error.
  2. The diagnostic does not show up in diagnostics tab when set to show "Intellisense only" diagnostics. Neither do red squigglies appear.
  3. Intellisense shows the generated members, e.g. when typing (| marks location of caret) public class Container : IContainer<int> { int x => _| } it will display _disposed in the completion list.
  4. You can navigate to the generated code, e.g. by clicking goto definition of _disposed in public class Container : IContainer<int> { int x => _disposed; }

Metadata

Metadata

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions