import * as vscode from 'vscode' ; import { Global } from './global' ; import CompletionItemProvider from './features/completionItemProvider' ; import DefinitionProvider from './features/definitionProvider' ; import DocumentSymbolProvider from './features/documentSymbolProvider' ; import ReferenceProvider from './features/referenceProvider' ; export function activate ( context ) { console . log ( 'Congratulations, your extension "code-gnu-global" is now active!' ) ; var configuration = vscode . workspace . getConfiguration ( 'codegnuglobal' ) ; var executable = configuration . get < string > ( 'executable' , 'global' ) ; const global = new Global ( executable ) ; context . subscriptions . push ( vscode . languages . registerCompletionItemProvider ( [ 'cpp' , 'c' ] , new CompletionItemProvider ( global ) , '.' , '>' ) ) ; context . subscriptions . push ( vscode . languages . registerDefinitionProvider ( [ 'cpp' , 'c' ] , new DefinitionProvider ( global ) ) ) ; context . subscriptions . push ( vscode . languages . registerDocumentSymbolProvider ( [ 'cpp' , 'c' ] , new DocumentSymbolProvider ( global ) ) ) ; context . subscriptions . push ( vscode . languages . registerReferenceProvider ( [ 'cpp' , 'c' ] , new ReferenceProvider ( global ) ) ) ; context . subscriptions . push ( vscode . workspace . onDidSaveTextDocument ( d => global . updateTags ( ) ) ) ; }