Skip to content

Commit

Permalink
Merge pull request #2919 from opral/felixhaeberle/sherl-84-remove-mig…
Browse files Browse the repository at this point in the history
…ratesettingsfrominlangtosherlock

remove `migrateSettingsFromInlangToSherlock` because migration period is over | Sherlock 🕵️‍♂️
  • Loading branch information
felixhaeberle authored Jun 10, 2024
2 parents a59ddcd + f472213 commit 19e2234
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 26 deletions.
5 changes: 5 additions & 0 deletions .changeset/violet-ways-fold.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"vs-code-extension": patch
---

remove migrateSettingsFromInlangToSherlock because its no longer needed
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { randomUUID } from "node:crypto"
import { getSetting, migrateSettingsFromInlangToSherlock, updateSetting } from "./index.js"
import { getSetting, updateSetting } from "./index.js"

/**
* Returns the user ID. If it doesn't exist yet, it will be generated and persisted.
Expand All @@ -10,9 +10,7 @@ import { getSetting, migrateSettingsFromInlangToSherlock, updateSetting } from "
* console.info(userId) // 123e4567-e89b-12d3-a456-426614174000
*/
export async function getUserId() {
// TODO: remove this migrate settings from inlang to sherlock after 01 April 2024
await migrateSettingsFromInlangToSherlock()

// Get the user ID
const persistedId = await getPersistedId()

if (!persistedId) {
Expand Down
22 changes: 0 additions & 22 deletions inlang/source-code/ide-extension/src/utilities/settings/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,31 +35,9 @@ export const updateSetting = async (property: SettingsProperty, value: any): Pro
*
*/
export const getSetting = async (property: SettingsProperty): Promise<any> => {
// TODO: remove this migrate settings from inlang to sherlock after 01 April 2024
migrateSettingsFromInlangToSherlock()

const value = vscode.workspace.getConfiguration("sherlock").get(property)
if (value === undefined) {
throw new Error(`Could not find configuration property ${property}`)
}
return value
}

/**
* Migrates settings from the old inlang namespace to the new sherlock namespace.
*/
// TODO: remove this migrate settings from inlang to sherlock after 01 April 2024
export const migrateSettingsFromInlangToSherlock = async () => {
if (vscode.workspace.getConfiguration("sherlock").get("userId")) {
return
}

const inlangSettings = vscode.workspace.getConfiguration("inlang")

for (const property of settingsProperty) {
const value = inlangSettings.get(property)
if (value !== undefined) {
await updateSetting(property, value)
}
}
}

0 comments on commit 19e2234

Please sign in to comment.