'use strict' ; import * as vscode from 'vscode' ; interface CodeSpellCheckerExtension { registerConfig ( path ) : Promise < void > ; enableLocal ( isGlobal , local ) : Promise < void > ; disableLocal ( isGlobal , local ) : Promise < void > ; } const local = 'hr' ; export function activate ( context ) { const vscodeSpellCheckerExtension = 'streetsidesoftware.code-spell-checker' ; const configLocation = context . asAbsolutePath ( './cspell-ext.json' ) ; const extension = vscode . extensions . getExtension < CodeSpellCheckerExtension > ( vscodeSpellCheckerExtension ) ; if ( extension ) { extension . activate ( ) . then ( ext => { ext ?. registerConfig ?. ( configLocation ) ; } ) ; } function enableCroatian ( isGlobal ) { extension && extension . activate ( ) . then ( ext => { ext ?. enableLocal ?. ( isGlobal , local ) ; } ) ; } function disableCroatian ( isGlobal ) { extension && extension . activate ( ) . then ( ext => { ext ?. disableLocal ?. ( isGlobal , local ) ; } ) ; } context . subscriptions . push ( vscode . commands . registerCommand ( 'cSpellExt_croatian.enableCroatian' , ( ) => enableCroatian ( true ) ) , vscode . commands . registerCommand ( 'cSpellExt_croatian.disableCroatian' , ( ) => disableCroatian ( true ) ) , vscode . commands . registerCommand ( 'cSpellExt_croatian.enableCroatianWorkspace' , ( ) => enableCroatian ( false ) ) , vscode . commands . registerCommand ( 'cSpellExt_croatian.disableCroatianWorkspace' , ( ) => disableCroatian ( false ) ) ) ; } export function deactivate ( ) { }