Skip to content

Commit 37bb04b

Browse files
committed
[wip] language-overridable settings
1 parent 980186c commit 37bb04b

1 file changed

Lines changed: 33 additions & 1 deletion

File tree

vscode-framework.config.js

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,44 @@
22
const { defineConfig } = require('@zardoy/vscode-utils/build/defineConfig.cjs')
33
const { patchPackageJson } = require('@zardoy/vscode-utils/build/patchPackageJson.cjs')
44

5+
/**
6+
* @typedef {Record<keyof import('./src/configurationType').Configuration, any>} Config
7+
*/
8+
9+
/** @type {(keyof Config)[]} */
10+
const languageOveridableSettings = [
11+
'removeUselessFunctionProps.enable',
12+
'removeOrMarkGlobalLibCompletions.action',
13+
'disableUselessHighlighting',
14+
'suggestions.keywordsInsertText',
15+
'caseSensitiveCompletions',
16+
'objectLiteralCompletions.moreVariants',
17+
'arrayMethodsSnippets.enable',
18+
'enableMethodSnippets',
19+
'removeImportsFromReferences',
20+
'removeDefinitionFromReferences',
21+
'removeCodeFixes.enable',
22+
]
23+
24+
// settings that just doesn't make sense to make language-overridable
25+
const dontMakeLanguageOverridableSettings = ['jsxPseudoEmmet.tags', 'jsxCompletionsMap', 'workspaceSymbolSearchExcludePatterns']
26+
527
patchPackageJson({
6-
patchSettings(configuration) {
28+
patchSettings(/** @type {Config} */ configuration) {
729
//prettier-ignore
830
configuration['jsxPseudoEmmet.tags'].default = {
931
div: true, span: true, input: "<input $1/>", p: true, form: true, footer: true, section: true, select: true, h1: true, h2: true, h3: true, h4: true, h5: true, h6: true,
1032
}
33+
// for (const key of languageOveridableSettings) {
34+
// configuration[key].scope = 'language-overridable'
35+
// }
36+
// by default all arrays and objects are language-overridable (with exception of some settings)
37+
// for (const [key, config] of Object.entries(configuration)) {
38+
// if (dontMakeLanguageOverridableSettings.includes(key)) continue
39+
// if (config.type === 'array' || config.type === 'object') {
40+
// config.scope = 'language-overridable'
41+
// }
42+
// }
1143
return configuration
1244
},
1345
})

0 commit comments

Comments
 (0)