'use strict' ; import * as vscode from 'vscode' ; import * as dict from 'cspell-dict-he' ; interface CodeSpellCheckerExtension { registerConfig ( path ) : Promise < void > ; enableLocal ( isGlobal , local ) : Promise < void > ; disableLocal ( isGlobal , local ) : Promise < void > ; } const local = 'he' ; 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 enableHebrew ( isGlobal ) { extension && extension . activate ( ) . then ( ext => { ext && ext . enableLocal && ext . enableLocal ( isGlobal , local ) ; } ) ; } function disableHebrew ( isGlobal ) { extension && extension . activate ( ) . then ( ext => { ext && ext . disableLocal && ext . disableLocal ( isGlobal , local ) ; } ) ; } context . subscriptions . push ( vscode . commands . registerCommand ( 'cSpellExt_hebrew.enableHebrew' , ( ) => enableHebrew ( true ) ) , vscode . commands . registerCommand ( 'cSpellExt_hebrew.disableHebrew' , ( ) => disableHebrew ( true ) ) , vscode . commands . registerCommand ( 'cSpellExt_hebrew.enableHebrewWorkspace' , ( ) => enableHebrew ( false ) ) , vscode . commands . registerCommand ( 'cSpellExt_hebrew.disableHebrewWorkspace' , ( ) => disableHebrew ( false ) ) ) ; } export function deactivate ( ) { }