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

Parse .Designer.cs file to detect renames #212

Open
tznind opened this issue Jun 21, 2023 · 0 comments
Open

Parse .Designer.cs file to detect renames #212

tznind opened this issue Jun 21, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@tznind
Copy link
Collaborator

tznind commented Jun 21, 2023

CodeToView is responsible for converting a users .Designer.cs code into a runtime state for the editor.

Currently the load process is as follows:

  • Create a CSharpSyntaxTree from the .Designer.cs file
  • Determine the view base class
  • Create an empty shell .cs parse tree (i.e. to get InitializeComponent and constructor)
  • Combine the two partials and compile into a new memory only assembly
  • Mount an instance in the editor
  • Apply runtime changes (making things visible, converting Data properties from string to Design etc (see CreateSubControlDesigns)

If a user renames fields manually then the Data property will not match the field name (see #211)

It should however be possible to use the CSharpSyntaxTree to find such assignments where the private field name does not match and either warn or override and take the users new name.

@tznind tznind added the enhancement New feature or request label Jun 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant