@@ -4,6 +4,7 @@ import { defaultJsSupersetLangs } from '@zardoy/vscode-utils/build/langs'
44import { Settings , extensionCtx , getExtensionSetting , getExtensionSettingId , registerExtensionCommand } from 'vscode-framework'
55import { pickObj } from '@zardoy/utils'
66import { watchExtensionSettings } from '@zardoy/vscode-utils/build/settings'
7+ import { ConditionalPick } from 'type-fest'
78import webImports from './webImports'
89import { sendCommand } from './sendCommand'
910import { registerEmmet } from './emmet'
@@ -16,7 +17,6 @@ import vueVolarSupport from './vueVolarSupport'
1617import moreCompletions from './moreCompletions'
1718import { mergeSettingsFromScopes } from './mergeSettings'
1819import codeActionProvider from './codeActionProvider'
19- import { ConditionalPick } from 'type-fest'
2020
2121let isActivated = false
2222// let erroredStatusBarItem: vscode.StatusBarItem | undefined
@@ -144,12 +144,13 @@ export const activate = async () => {
144144const registerDisableOptionalFeaturesCommand = ( ) => {
145145 registerExtensionCommand ( 'disableAllOptionalFeatures' , async ( ) => {
146146 const config = vscode . workspace . getConfiguration ( process . env . IDS_PREFIX , null )
147- const toDisable : [ keyof Settings , any ] [ ] = [ ]
147+ const toDisable : Array < [ keyof Settings , any ] > = [ ]
148148 for ( const optionalExperience of optionalExperiences ) {
149149 const desiredKey = Array . isArray ( optionalExperience ) ? optionalExperience [ 0 ] : optionalExperience
150150 const desiredValue = Array . isArray ( optionalExperience ) ? optionalExperience [ 1 ] : false
151151 if ( config . get ( desiredKey ) !== desiredValue ) toDisable . push ( [ desiredKey , desiredValue ] )
152152 }
153+
153154 const action = await vscode . window . showInformationMessage (
154155 `${ toDisable . length } features are going to be disabled` ,
155156 { detail : '' , modal : true } ,
@@ -160,20 +161,22 @@ const registerDisableOptionalFeaturesCommand = () => {
160161 switch ( action ) {
161162 case 'Write to settings NOW' : {
162163 for ( const [ key , value ] of toDisable ) {
163- config . update ( key , value , vscode . ConfigurationTarget . Global )
164+ void config . update ( key , value , vscode . ConfigurationTarget . Global )
164165 }
166+
165167 break
166168 }
169+
167170 case 'Copy settings' : {
168- vscode . env . clipboard . writeText ( JSON . stringify ( Object . fromEntries ( toDisable ) , undefined , 4 ) )
171+ await vscode . env . clipboard . writeText ( JSON . stringify ( Object . fromEntries ( toDisable ) , undefined , 4 ) )
169172 break
170173 }
171174 }
172175 } )
173176}
174177
175178/** Experiences that are enabled out of the box */
176- const optionalExperiences : ( keyof ConditionalPick < Settings , boolean > | [ keyof Settings , any ] ) [ ] = [
179+ const optionalExperiences : Array < keyof ConditionalPick < Settings , boolean > | [ keyof Settings , any ] > = [
177180 'enableMethodSnippets' ,
178181 'removeUselessFunctionProps.enable' ,
179182 'patchToString.enable' ,
0 commit comments