@@ -60,7 +60,7 @@ This section is broken down by user scenarios, with general solutions listed fir
### Generated class
**User scenario:** As a generator author I want to be able to add a type to the compilation, that can be referenced by the users code.
**User scenario:** As a generator author I want to be able to add a type to the compilation, that can be referenced by the user's code.
**Solution:** Have the user write the code as if the type was already present. Generate the missing type based on information available in the compilation.
...
...
@@ -83,8 +83,11 @@ public partial class UserClass
Create a generator that will create the missing type when run:
// if we didn't find the user class, there is nothing to do
return;
}
**Solution:** We expect there to be an an opt-in set of interactive interfaces that can be implemented to allow for progressively more complex generation strategies.
It is anticipated there will be a mechanism for providing symbol mapping for lighting up features such a 'Find all references'.
// add the generated implementation to the compilation
// determine which file changed, and if it affects this generator
// regenerate only the parts that are affected by this change.
// Business logic to decide what we're interested in goes here
if(syntaxNodeisClassDeclarationSyntaxcds&&
cds.Identifier.ValueText=="UserClass")
{
ClassToAugment=cds;
}
}
}
}
```
### INotifyPropertyChanged
...
...
@@ -275,6 +284,38 @@ public partial class UserClass : INotifyPropertyChanged
```
### Participate in the IDE experience
**Implementation Status**: Not Implemented.
**User scenario:** As a generator author I want to be able to interactively regenerate code as the user is editing files.
**Solution:** We expect there to be an opt-in set of interactive callbacks that can be implemented to allow for progressively more complex generation strategies.
It is anticipated there will be a mechanism for providing symbol mapping for lighting up features such as 'Find all references'.
<SuppressMessage("RoslynDiagnosticsReliability","RS0033:Importing constructor should be [Obsolete]",Justification:="Used in test code: https://github.com/dotnet/roslyn/issues/42814")>
// Used in https://github.com/aspnet/AspNetCore-Tooling/tree/master/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/OOPTagHelperResolver.cs