Closed Dblm0 closed 3 years ago
Most of problems I have with this project are within method that generates string as name of ISymbol... It seems that "namespace" is "concatenated" 3 times.. once for each namespace component for namespace A.B it would be generated A.B.A.B for namespace A.B.C it would be generated A.B.C.A.B.C.A.B.C... etc I'll fix it later tonight...
I hope I've fixed this Main reason I traverse over syntax nodes instead of simply calling ISymbol.Name for each element is scenario when two generic parameters from different elements have same name. In such case there is mapping between generic parameters on entire scope and I am pretty confident it works Here is an example. This conflict exists only on source level. During initial development of AutoInterface I considered generating SyntaxNode objects and then directly append them to compilation unit context. At that time such approach seemed inappropriate because I couldn't find way user to view generated source. Since then visualizer is added to Solution ToolWindow as you described.. When I find time, I'll try to add such code generation. Code will be generated much faster because there is no need for source parsing, and code is forward-only so limited set of new features would affect AutoInterface changes. Source templating in such case would be off...
Given dotted namespace
TestInterfaces.A.B
, declared in the same compile unit, I have the following generated code output:If the interface is located in a separate project, generated code, peeked in analyzers explorer, looks like the same, but it is right in the result. The solution compiles and you can see the desired code stepping intro it while debugging.
I've created a more complex example in forked repo, where the resulting namespace combination is more confusing.
Sorry for annoying you this whole week
Thanks in advance!