Skip to content

[XamlCodeGenerator] Map errors to XAML line numbers #17168

Open
@Youssef1313

Description

@Youssef1313

Current behavior

When an invalid XAML is encountered, it's not always easy to see where the error is.

Expected behavior

The source generator should generate #line directives instead of "comments" that mention line numbers. We should make sure that the current way of generating source information as comments is accurate enough before moving to #line right away.

That way, compile errors in generated code will easily map to XAML

For example:

using System;

class C
{
#line 11 "BlankPage1.xaml"
    code producing error; // the error here will point to Line 11 in BlankPage1.xaml
#line hidden

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/code-generationCategorizes an issue or PR as relevant to code generationdifficulty/tbdCategorizes an issue for which the difficulty level needs to be defined.kind/enhancementNew feature or requesttriage/untriagedIndicates an issue requires triaging or verification

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions