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

Use Semantic model for generating sources #1029

Merged
merged 16 commits into from
Jan 23, 2021
Merged

Conversation

clairernovotny
Copy link
Member

What kind of change does this PR introduce?

What is the current behavior?
Syntax parsing

What is the new behavior?
Semantic parsing

What might this PR break?

Please check if the PR fulfills these requirements

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

Other information:

@clairernovotny clairernovotny added enhancement semantic-analysis Bug reports/change requests that would require semantic analysis in the stub generator labels Jan 23, 2021
@todo
Copy link

todo bot commented Jan 23, 2021

we should allow source generators to provide source during initialize, so that this step isn't required.

// TODO: we should allow source generators to provide source during initialize, so that this step isn't required.
var options = (context.Compilation as CSharpCompilation).SyntaxTrees[0].Options as CSharpParseOptions;
var compilation = context.Compilation.AddSyntaxTrees(CSharpSyntaxTree.ParseText(SourceText.From(attributeText, Encoding.UTF8), options));
// get the newly bound attribute
var preserveAttributeSymbol = compilation.GetTypeByMetadataName($"{refitInternalNamespace}.PreserveAttribute");


This comment was generated by todo based on a TODO comment in 7d08d89 in #1029. cc @reactiveui.

@bennor
Copy link
Contributor

bennor commented Jan 23, 2021

Great to see this. It'll make a lot of people happy.

@todo
Copy link

todo bot commented Jan 23, 2021

we should allow source generators to provide source during initialize, so that this step isn't required.

// TODO: we should allow source generators to provide source during initialize, so that this step isn't required.
var options = (context.Compilation as CSharpCompilation)!.SyntaxTrees[0].Options as CSharpParseOptions;
var compilation = context.Compilation.AddSyntaxTrees(CSharpSyntaxTree.ParseText(SourceText.From(attributeText, Encoding.UTF8), options));
// get the newly bound attribute
var preserveAttributeSymbol = compilation.GetTypeByMetadataName($"{refitInternalNamespace}.PreserveAttribute")!;


This comment was generated by todo based on a TODO comment in 88a8573 in #1029. cc @reactiveui.

@todo
Copy link

todo bot commented Jan 23, 2021

we should allow source generators to provide source during initialize, so that this step isn't required.

// TODO: we should allow source generators to provide source during initialize, so that this step isn't required.
var options = (context.Compilation as CSharpCompilation)!.SyntaxTrees[0].Options as CSharpParseOptions;
var compilation = context.Compilation.AddSyntaxTrees(CSharpSyntaxTree.ParseText(SourceText.From(attributeText, Encoding.UTF8), options));
// get the newly bound attribute
var preserveAttributeSymbol = compilation.GetTypeByMetadataName($"{refitInternalNamespace}.PreserveAttribute")!;


This comment was generated by todo based on a TODO comment in b3c3e70 in #1029. cc @reactiveui.

@clairernovotny clairernovotny merged commit f6e30cf into main Jan 23, 2021
@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement semantic-analysis Bug reports/change requests that would require semantic analysis in the stub generator
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants