'use strict' ; import * as vscode from 'vscode' ; import { App , ElementCompletionItemProvider , DocumentHoverProvider } from './app' ; import { vueHelperDefinitionProvider } from './definitionProvider' ; import { JsCompletionItemProvider } from './js-complete' ; import { PxRem } from './px-rem' ; export function activate ( context ) { let app = new App ( ) ; let completionItemProvider = new ElementCompletionItemProvider ( ) ; let registrationHover = vscode . languages . registerHoverProvider ( 'vue' , new DocumentHoverProvider ) ; let pxRem = new PxRem ( ) ; let jsCompletionItemProvider = new JsCompletionItemProvider ( ) ; let completion = vscode . languages . registerCompletionItemProvider ( [ 'vue' , 'javascript' , 'html' ] , completionItemProvider , '' , ':' , '<' , '"' , "'" , '/' , '@' , '(' , '>' , '{' ) ; let vueLanguageConfig = vscode . languages . setLanguageConfiguration ( 'vue' , { wordPattern : app . WORD_REG } ) ; let jsCompletion = vscode . languages . registerCompletionItemProvider ( [ 'javascript' , 'html' , 'vue' ] , jsCompletionItemProvider , '.' , '(' ) ; let functionCompletionDisposable = vscode . commands . registerCommand ( 'vue-helper.functionCompletion' , ( ) => { app . autoComplement ( ) ; } ) ; let deleteCompleteDisposable = vscode . commands . registerCommand ( 'vue-helper.deleteComplete' , ( ) => { app . deleteComplete ( ) ; } ) ; let blockSelectDisposable = vscode . commands . registerCommand ( 'vue-helper.blockSelect' , ( ) => { app . blockSelect ( ) ; } ) ; let pxRemDisposable = vscode . commands . registerCommand ( 'vue-helper.pxRem' , ( ) => { pxRem . handle ( ) ; } ) ; let pxToRemDisposable = vscode . commands . registerCommand ( 'vue-helper.pxToRem' , ( ) => { pxRem . handlePxToRem ( 'px' ) ; } ) ; let remToPxDisposable = vscode . commands . registerCommand ( 'vue-helper.remToPx' , ( ) => { pxRem . handlePxToRem ( 'rem' ) ; } ) ; let vueHelperDefinition = vscode . languages . registerDefinitionProvider ( [ 'vue' , 'javascript' , 'html' ] , new vueHelperDefinitionProvider ( ) ) ; context . subscriptions . push ( app , completion , vueLanguageConfig , registrationHover , functionCompletionDisposable , deleteCompleteDisposable , vueHelperDefinition , pxRemDisposable , pxToRemDisposable , remToPxDisposable , blockSelectDisposable , jsCompletion ) ; } export function deactivate ( ) { }