Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(autocomplete): @datasourcename #1277

Merged
merged 4 commits into from
Nov 7, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions packages/language-server/src/__test__/quickFix.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ suite('Quick Fixes', () => {

let character = 11

if (process.platform === "win32") {
if (process.platform === 'win32') {
character = 12
}

Expand All @@ -240,7 +240,8 @@ suite('Quick Fixes', () => {
},
},
severity: 1,
message: 'Error parsing attribute "@relation": The argument `references` must refer to a unique criteria in the related model. Consider adding an `@unique` attribute to the field `field` in the model `A`.',
message:
'Error parsing attribute "@relation": The argument `references` must refer to a unique criteria in the related model. Consider adding an `@unique` attribute to the field `field` in the model `A`.',
},
],
edit: {
Expand Down
2 changes: 1 addition & 1 deletion packages/language-server/src/completion/completions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ export function getSuggestionForFieldAttribute(
label: '@' + datasourceName,
documentation:
'Defines a native database type that should be used for this field. See https://www.prisma.io/docs/concepts/components/prisma-schema/data-model#native-types-mapping',
insertText: '@db.$0',
Jolg42 marked this conversation as resolved.
Show resolved Hide resolved
insertText: `@${datasourceName}$0`,
insertTextFormat: InsertTextFormat.Snippet,
})
} else if (
Expand Down