@@ -395,7 +395,6 @@ function registerCommands(): void {
395395 disposables . push ( vscode . commands . registerCommand ( 'C_Cpp.ConfigurationEdit' , onEditConfiguration ) ) ;
396396 disposables . push ( vscode . commands . registerCommand ( 'C_Cpp.AddToIncludePath' , onAddToIncludePath ) ) ;
397397 disposables . push ( vscode . commands . registerCommand ( 'C_Cpp.ToggleErrorSquiggles' , onToggleSquiggles ) ) ;
398- disposables . push ( vscode . commands . registerCommand ( 'C_Cpp.ToggleSnippets' , onToggleSnippets ) ) ;
399398 disposables . push ( vscode . commands . registerCommand ( 'C_Cpp.ToggleIncludeFallback' , onToggleIncludeFallback ) ) ;
400399 disposables . push ( vscode . commands . registerCommand ( 'C_Cpp.ToggleDimInactiveRegions' , onToggleDimInactiveRegions ) ) ;
401400 disposables . push ( vscode . commands . registerCommand ( 'C_Cpp.ShowReleaseNotes' , onShowReleaseNotes ) ) ;
@@ -542,47 +541,6 @@ function onToggleSquiggles(): void {
542541 settings . toggleSetting ( "errorSquiggles" , "Enabled" , "Disabled" ) ;
543542}
544543
545- function onToggleSnippets ( ) : void {
546- onActivationEvent ( ) ;
547-
548- // This will apply to all clients as it's a global toggle. It will require a reload.
549- const snippetsCatName : string = "Snippets" ;
550- let newPackageJson : any = util . getRawPackageJson ( ) ;
551-
552- if ( newPackageJson . categories . findIndex ( cat => cat === snippetsCatName ) === - 1 ) {
553- // Add the Snippet category and snippets node.
554-
555- newPackageJson . categories . push ( snippetsCatName ) ;
556- newPackageJson . contributes . snippets = [ { "language" : "cpp" , "path" : "./cpp_snippets.json" } , { "language" : "c" , "path" : "./cpp_snippets.json" } ] ;
557-
558- fs . writeFile ( util . getPackageJsonPath ( ) , util . stringifyPackageJson ( newPackageJson ) , ( ) => {
559- showReloadPrompt ( "Reload Window to finish enabling C++ snippets" ) ;
560- } ) ;
561-
562- } else {
563- // Remove the category and snippets node.
564- let ndxCat : number = newPackageJson . categories . indexOf ( snippetsCatName ) ;
565- if ( ndxCat !== - 1 ) {
566- newPackageJson . categories . splice ( ndxCat , 1 ) ;
567- }
568-
569- delete newPackageJson . contributes . snippets ;
570-
571- fs . writeFile ( util . getPackageJsonPath ( ) , util . stringifyPackageJson ( newPackageJson ) , ( ) => {
572- showReloadPrompt ( "Reload Window to finish disabling C++ snippets" ) ;
573- } ) ;
574- }
575- }
576-
577- function showReloadPrompt ( msg : string ) : void {
578- let reload : string = "Reload" ;
579- vscode . window . showInformationMessage ( msg , reload ) . then ( value => {
580- if ( value === reload ) {
581- vscode . commands . executeCommand ( "workbench.action.reloadWindow" ) ;
582- }
583- } ) ;
584- }
585-
586544function onToggleIncludeFallback ( ) : void {
587545 onActivationEvent ( ) ;
588546 // This only applies to the active client.
0 commit comments