Skip to content

Commit

Permalink
Fix replace code action rule
Browse files Browse the repository at this point in the history
  • Loading branch information
bugarela committed Oct 9, 2023
1 parent 2340955 commit a09ad91
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions quint/src/parsing/parseErrors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,14 @@ export function undercaseTypeError(id: bigint, name: string): QuintError {
code: 'QNT007',
message: 'type names must start with an uppercase letter',
reference: id,
data: name[0].match('[A-Z]')
? { fix: { kind: 'replace', original: name[0], replacement: name[0].toUpperCase() } }
data: name[0].match('[a-z]')
? {
fix: {
kind: 'replace',
original: `type ${name[0]}`,
replacement: `type ${name[0].toUpperCase()}`,
},
}
: {},
}
}
Expand Down

0 comments on commit a09ad91

Please sign in to comment.