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