1
1
import * as vscode from 'vscode'
2
2
import lodash from 'lodash'
3
+ import { getExtensionContributionsPrefix } from 'vscode-framework'
3
4
import { Configuration } from './configurationType'
4
5
5
6
const settingsToIgnore = [ ] as Array < keyof Configuration >
@@ -14,9 +15,10 @@ export const mergeSettingsFromScopes = (
14
15
configuration : { properties } ,
15
16
} ,
16
17
} = packageJson
17
- for ( const [ key , item ] of Object . entries ( properties ) ) {
18
- const isObject = item . type !== 'object'
19
- if ( ( isObject && item . type !== 'array' ) || settingsToIgnore . includes ( key as keyof Configuration ) ) {
18
+ for ( const [ fullKey , item ] of Object . entries ( properties ) ) {
19
+ const key = fullKey . slice ( getExtensionContributionsPrefix ( ) . length )
20
+ const isObject = item . type === 'object'
21
+ if ( ( ! isObject && item . type !== 'array' ) || settingsToIgnore . includes ( key as keyof Configuration ) ) {
20
22
continue
21
23
}
22
24
@@ -28,7 +30,6 @@ export const mergeSettingsFromScopes = (
28
30
const getConfigValueFromAllScopes = < T extends keyof Configuration > ( configKey : T , language : string , type : 'array' | 'object' ) : Configuration [ T ] => {
29
31
const values = { ...vscode . workspace . getConfiguration ( process . env . IDS_PREFIX , { languageId : language } ) . inspect < any [ ] > ( configKey ) ! }
30
32
const userValueKeys = Object . keys ( values ) . filter ( key => key . endsWith ( 'Value' ) && ! key . startsWith ( 'default' ) )
31
- console . log ( userValueKeys )
32
33
for ( const key of userValueKeys ) {
33
34
if ( values [ key ] !== undefined ) {
34
35
continue
0 commit comments