Skip to content

Commit

Permalink
Make preview features regex more tolerant of spacing
Browse files Browse the repository at this point in the history
Co-authored-by: Joël Galeran <[email protected]>
  • Loading branch information
Druue and Jolg42 authored May 28, 2024
1 parent 6f09510 commit e5a8e0c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/language-server/src/lib/ast/configBlock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ export function getAllPreviewFeaturesFromGenerators(schema: PrismaSchema): Previ
* generator client {
* provider = "prisma-client-js"
* // previewFeatures = [] // This will be ignored
* previewFeatures = ["views"]
* previewFeatures = ["views"]
* }
* ```
*
* ? for more info: https://regex101.com/r/ezoTU2/1
* ? for more info: https://regex101.com/r/ezoTU2/2
*/
const previewFeaturesRegex = /^\s*(?!\/\/\s)previewFeatures\s=\s(\[.*\])/m
const previewFeaturesRegex = /^\s*(?!\/\/\s)previewFeatures\s*=\s*(\[.*\])/m

const result = schema.findWithRegex(previewFeaturesRegex)

Expand Down

0 comments on commit e5a8e0c

Please sign in to comment.