Skip to content

Support reusing the semantic model provided by the source generator.#927

Open
teo-tsirpanis wants to merge 1 commit into
Sergio0694:mainfrom
teo-tsirpanis:reuse-semantic-model
Open

Support reusing the semantic model provided by the source generator.#927
teo-tsirpanis wants to merge 1 commit into
Sergio0694:mainfrom
teo-tsirpanis:reuse-semantic-model

Conversation

@teo-tsirpanis

Copy link
Copy Markdown

Closes #<ISSUE_NUMBER>

Description

This PR updates SemanticModelProvider to be constructed with the semantic model contained in the source generator's GeneratorAttributeSyntaxContext, and to return that when requesting a SemanticModel for a node with the same SyntaxTree as the originally provided SemanticModel.

This way we avoid creating additional SemanticModels when the shader's entire definition is in the same file.

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

Successfully merging this pull request may close these issues.

1 participant