Skip to content

Razor TODO comments should be listed in the task list #4446

@stefanloerwald

Description

@stefanloerwald

Is your feature request related to a problem? Please describe.

Keeping track of TODO items in Visual studio can be done using the Task List. It lists any comment using specific tokens (as defined in the settings, default are HACK, TODO, UNDONE, and UnresolvedMergeConflict).

For regular code, any of the following examples produce an entry in the task list:

///<summary>
/// TODO example1
///</summary>
public void Foo()
{
  // TODO example2
  Bar();
  /* TODO example3 */
  Baz();
}

So all methods of writing comments are supported. This is not true for razor files. According to the razor syntax reference documentation, @* *@ denotes a razor comment block. However, I guess it must more accurately be described as "this block will not be present in any form in the generated code", and thus also does not make its way into the task list:

Razor file

<!--TODO this works (html comment)-->
@{
   // TODO this works (C# comment)
   /* TODO this works (C# multi-line comment) */
}
@* TODO this doesn't work (razor comment) *@

Describe the solution you'd like

For task tracking in razor files, it would be very helpful to also support razor-style comment blocks. Given that a razor comment block can contain anything, including C# comments, it's probably not a good idea to change the behavior of the razor compiler to emit the razor comment block into the generated code in any form, so I suspect this should be an IDE-only change.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions