dotnet / dotnet/roslyn

Store generated location of class name on a `RazorCodeDocument`

Open
#85,655 0 comments 0 reactions 0 assignees View on GitHub
Area-Razor Area-Razor-Compiler
Dominant language
C#
Stars
20.7k
Forks
4.3k
PR merge metrics
PR metrics pending

Description

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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.