import * as vscode from 'vscode' ; import PHPCompletionItemProvider from './features/completionItemProvider' ; import PHPHoverProvider from './features/hoverProvider' ; import PHPSignatureHelpProvider from './features/signatureHelpProvider' ; import PHPValidationProvider from './features/validationProvider' ; export function activate ( context ) { let validator = new PHPValidationProvider ( context . workspaceState ) ; validator . activate ( context . subscriptions ) ; context . subscriptions . push ( vscode . languages . registerCompletionItemProvider ( 'php' , new PHPCompletionItemProvider ( ) , '>' , '$' ) ) ; context . subscriptions . push ( vscode . languages . registerHoverProvider ( 'php' , new PHPHoverProvider ( ) ) ) ; context . subscriptions . push ( vscode . languages . registerSignatureHelpProvider ( 'php' , new PHPSignatureHelpProvider ( ) , '(' , ',' ) ) ; vscode . languages . setLanguageConfiguration ( 'php' , { wordPattern : /(-?\d*\.\d\w*)|([^\-\`\~\!\@\#\%\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g , onEnterRules : [ { beforeText : /^\s*\/\*\*(?!\/)([^\*]|\*(?!\/))*$/ , afterText : /^\s*\*\/$/ , action : { indentAction : vscode . IndentAction . IndentOutdent , appendText : ' * ' } } , { beforeText : /^\s*\/\*\*(?!\/)([^\*]|\*(?!\/))*$/ , action : { indentAction : vscode . IndentAction . None , appendText : ' * ' } } , { beforeText : /^(\t|(\ \ ))*\ \*(\ ([^\*]|\*(?!\/))*)?$/ , action : { indentAction : vscode . IndentAction . None , appendText : '* ' } } , { beforeText : /^(\t|(\ \ ))*\ \*\/\s*$/ , action : { indentAction : vscode . IndentAction . None , removeText : 1 } } , { beforeText : /^(\t|(\ \ ))*\ \*[^/]*\*\/\s*$/ , action : { indentAction : vscode . IndentAction . None , removeText : 1 } } ] } ) ; }