Skip to content

Support formatting Avalonia XAML files #554

@seleborg

Description

@seleborg

Is your feature request related to a problem? Please describe.
With the new Avalonia for VS Code extension (using v 1.0.4 at the time of writing this), there seems to be an incompatibility in the file type for *.axaml files. The Avalonia extension introduces the file type Avalonia XAML, which needs to be the file's language mode for the preview feature to work. If setting the language mode to XAML, the no preview button is available.

However, setting XAML Styler as the default formatter for the Avalonia XAML file type in settings.json makes VS Code display an error:

    "[axaml]": {
        "editor.defaultFormatter": "dabbinavo.xamlstyler",
    }

Formatting -- Extension 'XAML Styler' is configured as formatter but it cannot format 'Avalon...'

Image

Describe the solution you'd like
My naive solution would be to have the settings snippet above work. But maybe there is a more elegant solution?

Describe alternatives you've considered
The Avalonia for VS Code extension does format XAML files, but it can't be configured, so it wants to reformat all my XAML files automatically all the time.

Additional context
As discussed here: AvaloniaUI/AvaloniaVSCode#44

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions