Skip to content

Conversation

@geket
Copy link
Contributor

@geket geket commented Nov 26, 2025

Foreword & Motivation

While building a TypeScript based ecommerce platform for a client, after I changed our current SQL seed integration and went to mess around with the Prisma schema, I noticed Notepad++ was not formatting or allowing me to collapse any part of the code. Upon checking for the best language to use to exhibit similar behavior, I noticed I could define a language and remembered not too long ago I followed NPP on Github. I figured why not see what I could do here.

I went ahead and I made one for NPP, I've been using your wonderful software for years and I figured I'd contribute at least something, thanks for all your hard work fellow devs.

I made an issue at first before I realized I could make a PR, #358 which I closed. Happy to make any changes to fix any nits.

Prisma Schema Language UDL for Notepad++

Special Features

Comprehensive Keyword Coverage

  • Block-level keywords: model, enum, datasource, generator, type, view
  • Scalar types: String, Int, Float, Boolean, DateTime, Json, Bytes, Decimal, BigInt, Unsupported
  • Database providers: postgresql, mysql, sqlite, sqlserver, mongodb, cockroachdb

Full Attribute Support with Prefix Handling

  • Field attributes (@ prefix): @id, @default, @unique, @relation, @map, @updatedAt, @ignore, @db
  • Block attributes (@@ prefix): @@id, @@unique, @@index, @@map, @@ignore, @@schema, @@shardKey, @@fulltext
  • Uses Notepad++ UDL prefix feature for proper @ and @@ symbol recognition

Attribute Functions & Values

  • Generator functions: autoincrement, cuid, uuid, ulid, nanoid, now, auto, dbgenerated, sequence
  • Environment functions: env
  • Boolean literals: true, false, null
  • Referential actions: Cascade, Restrict, NoAction, SetNull, SetDefault
  • Sort order: Asc, Desc

Configuration Options

  • Datasource options: provider, url, shadowDatabaseUrl, directUrl, relationMode, extensions
  • Generator options: output, previewFeatures, engineType, binaryTargets
  • Relation options: fields, references, onDelete, onUpdate, name

Native Database Type Annotations

  • Supports @db.* type annotations for database-specific types
  • Common types: ObjectId, Uuid, Text, VarChar, Char, SmallInt, Double, Date, Time, Timestamp, JsonB, ByteA

Comment Support

  • Line comments: //
  • Documentation comments: /// (treated same as line comments for highlighting)
  • Block comments: /* */

Code Folding

  • Curly brace folding { } for model, enum, datasource, and generator blocks
  • Comment folding support enabled

Color Scheme (Light Theme)

Element Color Style
Block keywords (model, enum, etc.) Blue Bold
Scalar types (String, Int, etc.) Purple Bold
Field attributes (@id, @default, etc.) Red Normal
Block attributes (@@id, @@unique, etc.) Red Bold
Functions (autoincrement, uuid, etc.) Magenta Normal
Config options (provider, url, etc.) Olive Normal
Providers & actions (postgresql, Cascade, etc.) Teal Normal
Native types (prisma-client-js, ObjectId, etc.) Purple Normal
Strings Gray Normal
Numbers Orange Normal
Comments Green Italic
Operators & Braces Cyan Bold

References

Official Prisma Documentation

Schema Components

Field & Block Attributes

Database-Specific Features

Prisma Schema Reference (Complete)


Compatibility

  • Notepad++ Version: 7.8+ (UDL 2.1 format)
  • Theme: Designed for light themes (default Notepad++ theme)
  • File Extension: .prisma

@pryrt pryrt merged commit ced5836 into notepad-plus-plus:master Nov 26, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants