Skip to content

Commit

Permalink
chore(ls): remove if referentialIntegrity preview feature flag (#1288)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jolg42 committed Nov 24, 2022
1 parent f7f72a5 commit 6fcd50e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 22 deletions.
14 changes: 0 additions & 14 deletions packages/language-server/src/__test__/completion.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,6 @@ suite('Completions', function () {

test('relationMode = "|"', () => {
assertCompletion({
previewFeatures: ['referentialIntegrity'],
schema: /* Prisma */ `
datasource db {
provider = "sqlite"
Expand All @@ -365,7 +364,6 @@ suite('Completions', function () {
})
test('relationMode = |', () => {
assertCompletion({
previewFeatures: ['referentialIntegrity'],
schema: /* Prisma */ `
datasource db {
relationMode = |
Expand All @@ -376,18 +374,6 @@ suite('Completions', function () {
},
})
})
test('relationMode = | (without previewFeature)', () => {
assertCompletion({
schema: /* Prisma */ `
datasource db {
relationMode = |
}`,
expected: {
isIncomplete: false,
items: [],
},
})
})
})

suite('GENERATOR BLOCK', () => {
Expand Down
9 changes: 2 additions & 7 deletions packages/language-server/src/completion/completions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ export function getSuggestionForSupportedFields(
// We can filter on the datasource
const datasourceProvider = getFirstDatasourceProvider(lines)
// We can filter on the previewFeatures enabled
const previewFeatures = getAllPreviewFeaturesFromGenerators(lines)
// const previewFeatures = getAllPreviewFeaturesFromGenerators(lines)

switch (blockType) {
case 'generator':
Expand Down Expand Up @@ -450,12 +450,7 @@ export function getSuggestionForSupportedFields(
}
}
// `relationMode` can only be set for SQL databases
// TODO remove conditional on preview feature flag when going GA
else if (
previewFeatures?.includes('referentialintegrity') &&
currentLine.startsWith('relationMode') &&
datasourceProvider !== 'mongodb'
) {
else if (currentLine.startsWith('relationMode') && datasourceProvider !== 'mongodb') {
const relationModeValuesSuggestion: CompletionItem[] = relationModeValues
// values inside quotes `"value"`
const relationModeValuesSuggestionWithQuotes: CompletionItem[] = klona(relationModeValuesSuggestion).map(
Expand Down
2 changes: 1 addition & 1 deletion packages/language-server/src/previewFeatures.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export type PreviewFeatures =
// value must be lowercase
Lowercase<'fullTextIndex'> | Lowercase<'referentialIntegrity'>
Lowercase<'fullTextIndex'>

0 comments on commit 6fcd50e

Please sign in to comment.