language-tools icon indicating copy to clipboard operation
language-tools copied to clipboard

Syntax Highlighting breaks for Enum when there is no space between the enum's name and the curly `{`

Open ITyukz11 opened this issue 9 months ago • 2 comments

![image](https://github.co syntax enum error m/prisma/language-tools/assets/138852354/5652b33d-4261-432c-b4ca-15befd2e1cce)

ITyukz11 avatar May 10 '24 03:05 ITyukz11

I think the problem is that the syntax highlighting requires a space between the enum's name and the {

See broken

enum UserType{
    ADMIN
    NORMAL
}

works

enum UserType {
    ADMIN
    NORMAL
}

Jolg42 avatar May 13 '24 08:05 Jolg42

Usually auto-formatting would fix this, with the CLI you can use npx prisma format manually.

Note: the syntax is defined here -> https://github.com/prisma/language-tools/blob/main/packages/vscode/syntaxes/prisma.tmLanguage.json

Jolg42 avatar May 13 '24 08:05 Jolg42