Skip to content

Format block of text with specified language #794

@murdos

Description

@murdos

It would be nice if prettier-java could delegate to prettier the formatting of block of text that is commented with language = ....

E.g.

// language = json
String someJson = """
{"glossary":{"title": "example glossary"}}
"""

Expected behavior:

// language = json
String someJson = """
{
    "glossary": { 
        "title": "example glossary",
    }
}
"""

language = <language> is supported by Jetbains IDEs: adding this comment allow syntax highlighting, code completion and verification.

This would be similar to what Prettier does out of the box with block of code inside Mardown such as:

```json
{
  "firstName": "John",
  "lastName": "Smith",
  "age": 25
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions