Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Intellisense reporting error for source generated type, but runs fine #660

Closed
MisinformedDNA opened this issue Nov 23, 2020 · 3 comments
Closed

Comments

@MisinformedDNA
Copy link

The intellisense keeps reporting an error that the source generated type doesn't exist, but the type is found in the assembly and and the error doesn't block the build anyway.

Repro:

  1. Clone https://github.com/davidwengier/SourceGeneratorTemplate
  2. Open VS2019 16.8.1
  3. Run ConsoleApp
  4. Note that it runs fine and Foo is listed as a type in the assembly
  5. Open Program.cs in ConsoleApp
  6. Add var foo = new Foo();

EXPECTED: Type is recognized.

ACTUAL: Get compiler error

The type or namespace name 'Foo' could not be found (are you missing a using directive or an assembly reference?)

image

  1. Run ConsoleApp
  2. Note that it runs fine even with the error
@jmarolf
Copy link
Contributor

jmarolf commented Nov 23, 2020

@chsienki should this be in this repo or moved to roslyn?

@ugumba
Copy link

ugumba commented Dec 8, 2020

Seconded. Without Intellisense, generated code is almost impossible to consume - especially as it is not even put anywhere on disk (that I could find).

@chsienki
Copy link
Contributor

chsienki commented Dec 8, 2020

I'm pretty sure this is another case of dotnet/roslyn#48083

I'll close this as a dupe, but feel free to add onto the referenced bug.

@chsienki chsienki closed this as completed Dec 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants