Skip to content

Commit

Permalink
fix(defineConfigObject): should wrap config object as reactive object
Browse files Browse the repository at this point in the history
  • Loading branch information
KermanX committed Nov 8, 2024
1 parent 82fe322 commit 7b7857a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/core/src/utils/defineConfigObject.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { UnwrapNestedRefs } from '@reactive-vscode/reactivity'
import type { ConfigurationScope, ConfigurationTarget } from 'vscode'
import type { ConfigTypeOptions, ParseConfigTypeOptions } from './defineConfigs'
import type { Nullable } from './types'
import { reactive, type UnwrapNestedRefs } from '@reactive-vscode/reactivity'
import { defineConfigs } from './defineConfigs'

export type ConfigObject<C extends object> = UnwrapNestedRefs<C> & {
Expand Down Expand Up @@ -31,14 +31,14 @@ export function defineConfigObject(section: Nullable<string>, configs: Record<st
const configRefs = defineConfigs(section, configs, scope)

const nestedKeys: any = {}
const rawData: any = {
const rawData: any = reactive({
$update(key: string, value: any, configurationTarget: any, overrideInLanguage: any) {
return configRefs[key].update(value, configurationTarget, overrideInLanguage)
},
$set(key: string, value: any) {
return configRefs[key].set(value)
},
}
})
for (const key in configs) {
const path = key.split('.')
let prefix = ''
Expand Down

0 comments on commit 7b7857a

Please sign in to comment.