There are a couple of spots where we use the C# syntax tree to find the class declaration in the generated C# file for a Razor document.
- In Implement Abstract Interface support, to expand our code action range
- In Go To Def and Find All Refs, to detect when Roslyn wants to navigate users to the class
We could have the compiler store the location of the class name somewhere, either the RazorCodeDocument or the tree it contains, which would mean these features could avoid needing to ask Roslyn to parse the generated tree, which could save time and memory.
There are a couple of spots where we use the C# syntax tree to find the class declaration in the generated C# file for a Razor document.
We could have the compiler store the location of the class name somewhere, either the
RazorCodeDocumentor the tree it contains, which would mean these features could avoid needing to ask Roslyn to parse the generated tree, which could save time and memory.