I'm currently implementing a similar plugin to the T4 templates - handling a custom language implementation which generates c# code as output in "code behind".
Needless to say I have been analyzing the PSI plugin code - as well as the ForTea T4 templates plugin project (amazing work by the author there!)
I have more or less the basics setup:
* General custom language implementation etc... pretty much following the examples and your code...
* Parser / Lexer is implemented - files are parsed and PSI is generated...
* Simple syntax highlightning - with the CSharp implementation backing it...
* Simple error messages output for just the parsing (no code analysis yet...)
What I'm currently trying to figure out is the "CodeBehind" concept:
I was hoping that perhaps you could help me out understand what this is used for?
- I do understand that this service generates a C# PSI(or whatever you choose as language) file for the custom language, and I have also plugged a custom GeneratedDocumentService in my solution, which generates some sample code...
- But it doesn't seem like this is actually used in the compilation of the projects or anything like that right? / nor does it seem to add any additional "Document view" to the ProjectItem to be displayed.
- My naive thought was that this probably generates the C# code that is generated in the "code behind" file that you can open in VS - but that seems to bee completely unrealated...
- So is the result of this only used internally by Resharper to add "code navigation" / "syntax highlighting" / "code analysis"?
I would really appreciate if anyone could help me with some pointers on the subject! :)
While I'm at it - what is the purpose of the "FileDependency" class? - what is it used for?
- Is it used for "code analysis" / "syntax coloring" internally by Resharper?
- As it seems to be a ShellComponent - it seems like it's per Solution basis? (would that mean it also keeps track of the required extenral assemblies too? etc..?)