Skip to content

[Feature Request] Add custom file extension / language associations for Syntax Highlighting #2727

Description

@evilbaschdi

Problem

Many tools use custom file extensions for standard file formats (e.g., .xrm or .vsconfig for JSON, .axaml or .slnx for XML).

Currently, SourceGit doesn't recognize these custom extensions as standard JSON/XML - or most of them, which affects syntax highlighting in the diff/file viewer. Hardcoding these extensions directly into SourceGit wouldn't be maintainable long-term.

Proposed Solution

Implement a customizable file association mapping similar to VS Code's files.associations setting.

VS Code handles this cleanly through files.associations, allowing users to seamlessly map glob patterns or custom extensions to built-in language parsers.

"files.associations": {
        "*.axaml": "xml",
        "*.DotSettings": "xml",
        "*.fakes": "xml",
        "*.lutconfig": "xml",
        "*.ncrunchproject": "xml",
        "*.ncrunchsolution": "xml",
        "*.osts": "ts",
        "*.pssproj": "xml",
        "*.slnx": "xml",
        "*.user": "xml",
        "*.vbm": "xml",
        "*.vsconfig": "json",
        "*.vsext": "json",
        "*.vsixmanifest": "xml",
        "*.xrm": "json",
        "*.xrm2": "json",
        "*.xrmconfig": "json",
        "*.xrmsuo": "json",
        "Bookmarks*": "json"
    }

This could be configured via preference.json (or exposed in the Preference window).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions