import { commands , ExtensionContext , window } from 'vscode' ; import * as book from './bookUtil' ; export function activate ( context ) { console . log ( 'Congratulations, your extension "thief-book" is now active!' ) ; let displayCode = commands . registerCommand ( 'extension.displayCode' , ( ) => { let lauage_arr_list = [ 'Java - System.out.println("Hello World");' , 'C++ - cout << "Hello, world!" << endl;' , 'C - printf("Hello, World!");' , 'Python - print("Hello, World!")' , 'PHP - echo "Hello World!";' , 'Ruby - puts "Hello World!";' , 'Perl - print "Hello, World!";' , 'Lua - print("Hello World!")' , 'Scala - println("Hello, world!")' , 'Golang - fmt.Println("Hello, World!")' ] ; var index = Math . floor ( ( Math . random ( ) * lauage_arr_list . length ) ) ; window . setStatusBarMessage ( lauage_arr_list [ index ] ) ; } ) ; let getNextPage = commands . registerCommand ( 'extension.getNextPage' , ( ) => { let books = new book . Book ( context ) ; window . setStatusBarMessage ( books . getNextPage ( ) ) ; } ) ; let getPreviousPage = commands . registerCommand ( 'extension.getPreviousPage' , ( ) => { let books = new book . Book ( context ) ; window . setStatusBarMessage ( books . getPreviousPage ( ) ) ; } ) ; let getJumpingPage = commands . registerCommand ( 'extension.getJumpingPage' , ( ) => { let books = new book . Book ( context ) ; window . setStatusBarMessage ( books . getJumpingPage ( ) ) ; } ) ; context . subscriptions . push ( displayCode ) ; context . subscriptions . push ( getNextPage ) ; context . subscriptions . push ( getPreviousPage ) ; context . subscriptions . push ( getJumpingPage ) ; } export function deactivate ( ) { }