Skip to content

Commit

Permalink
fix(ls): an error string changed and needed to be updated (#1709)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jolg42 committed Apr 24, 2024
1 parent 6c897c3 commit 2989181
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
7 changes: 3 additions & 4 deletions packages/language-server/src/__test__/linting.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ suite('Linting', () => {
assertLinting(
[
{
message: 'Type "Use" is neither a built-in type, nor refers to another model, custom type, or enum.',
message: 'Type "Use" is neither a built-in type, nor refers to another model, composite type, or enum.',
range: {
start: { line: 14, character: 12 },
end: { line: 14, character: 15 },
Expand Down Expand Up @@ -101,9 +101,8 @@ suite('Linting', () => {
assertLinting(
[
{
message: `The preview feature "huh" is not known. Expected one of: ${previewFeatures.join(
', ',
)}.\nIf this is unexpected, it might be due to your Prisma VS Code Extension being out of date.`,
message: `The preview feature "huh" is not known. Expected one of: ${previewFeatures.join(', ')}.
If this is unexpected, it might be due to your Prisma VS Code Extension being out of date.`,
range: {
start: { line: 2, character: 22 },
end: { line: 2, character: 29 },
Expand Down
5 changes: 4 additions & 1 deletion packages/language-server/src/lib/code-actions/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,10 @@ export function quickFix(
if (
diag.severity === DiagnosticSeverity.Error &&
diag.message.startsWith('Type') &&
diag.message.includes('is neither a built-in type, nor refers to another model, custom type, or enum.')
// In 5.13.0 and earlier we used "custom type" instead of "composite type"
// So we only check the beginning of the message for simplicity
// See https://github.com/prisma/prisma-engines/pull/4813
diag.message.includes('is neither a built-in type, nor refers to another model,')
) {
let diagText = textDocument.getText(diag.range)
const hasTypeModifierArray: boolean = diagText.endsWith('[]')
Expand Down

0 comments on commit 2989181

Please sign in to comment.