-
Notifications
You must be signed in to change notification settings - Fork 185
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
FUSE - Component attributes are written as strings #10403
Comments
This was a change in #7974 to enable better tooling for component attributes. Go to Def, Find All Refs, Rename etc. It allows Roslyn to "see" that a component attribute is semantically a property reference. My preference here would be to maintain the design time behaviour in some way (just look at the number of issues that PR fixes). Potentially replacing the string with a Alternatively, we could just generate some extra code for IDE support (maybe a method in a file scoped class that is never called?). I suspect there might be more instances where tooling wants different code than runtime needs. |
I see, the main concern is that
This might be a good solution in the long run. The question here would be perf oriented since a lot of the runtime code, afaik, is geared towards minimizing edits for interactive rendering. |
I'm not sure I understand what this means, but in any case the code generation I'm talking about would have no runtime impact as far as I'm aware. For example, in order for the generate method code action to be available, we could simply emit into the generated code:
Unless the runtime is using reflection to poke through the generated classes, I wouldn't imagine it would matter. |
I was overthinking it. In my mind it was doing something clever like replacing the code with __builder.AddComponentParameter(6, SomeThing(b => b.Title, "Title"), "How is Blazor working for you?");
string Something(Func<...> _, string) s) => s; Which in hindsight and not mid-meeting clarity is definitely wrong :) |
Design time writes out the actual property reference, which causes gotodef to work when mapping. GoToDef fails in fuse for these cases. @davidwengier it looks like in single server we opted to ask for Roslyn to answer these but prior we would handle ourselves? Maybe you have some more insight.
Potential solution: Can the tooling side be smarter here? Can we make a fully qualified name and ask for roslyn to find the definition locations and find a mapping for those?
Fuse
Without Fuse
The text was updated successfully, but these errors were encountered: