'use strict' ; import * as vscode from 'vscode' ; import * as dict from 'cspell-dict-uk-ua' ; interface CodeSpellCheckerExtension { registerConfig ( path ) : Promise < void > ; enableLocal ( isGlobal , local ) : Promise < void > ; disableLocal ( isGlobal , local ) : Promise < void > ; } const local = 'uk' ; export function activate ( context ) { const vscodeSpellCheckerExtension = 'streetsidesoftware.code-spell-checker' ; const extension = vscode . extensions . getExtension < CodeSpellCheckerExtension > ( vscodeSpellCheckerExtension ) ; if ( extension ) { extension . activate ( ) . then ( ext => { const path = dict . getConfigLocation ( ) ; ext && ext . registerConfig && ext . registerConfig ( path ) ; } ) ; } function enableUkrainian ( isGlobal ) { extension && extension . activate ( ) . then ( ext => { ext && ext . enableLocal && ext . enableLocal ( isGlobal , local ) ; } ) ; } function disableUkrainian ( isGlobal ) { extension && extension . activate ( ) . then ( ext => { ext && ext . disableLocal && ext . disableLocal ( isGlobal , local ) ; } ) ; } context . subscriptions . push ( vscode . commands . registerCommand ( 'cSpellExt_ukrainian.enableUkrainian' , ( ) => enableUkrainian ( true ) ) , vscode . commands . registerCommand ( 'cSpellExt_ukrainian.disableUkrainian' , ( ) => disableUkrainian ( true ) ) , vscode . commands . registerCommand ( 'cSpellExt_ukrainian.enableUkrainianWorkspace' , ( ) => enableUkrainian ( false ) ) , vscode . commands . registerCommand ( 'cSpellExt_ukrainian.disableUkrainianWorkspace' , ( ) => disableUkrainian ( false ) ) ) ; } export function deactivate ( ) { }