@@ -49,6 +49,21 @@ function shouldActivate(): boolean {
4949export async function activate ( context : vscode . ExtensionContext ) {
5050 info ( "Activating Laravel Extension..." ) ;
5151
52+ initPhp ( ) ;
53+
54+ context . subscriptions . push (
55+ vscode . commands . registerCommand ( "laravel.open" , openFileCommand ) ,
56+ vscode . commands . registerCommand ( "laravel.runPint" , runPint ) ,
57+ vscode . commands . registerCommand (
58+ "laravel.runPintOnCurrentFile" ,
59+ runPintOnCurrentFile ,
60+ ) ,
61+ vscode . commands . registerCommand (
62+ "laravel.runPintOnDirtyFiles" ,
63+ runPintOnDirtyFiles ,
64+ ) ,
65+ ) ;
66+
5267 if ( ! shouldActivate ( ) ) {
5368 info (
5469 'Not activating Laravel Extension because "shouldActivate" returned false' ,
@@ -95,7 +110,6 @@ export async function activate(context: vscode.ExtensionContext) {
95110
96111 const LANGUAGES = [ { scheme : "file" , language : "php" } , ...BLADE_LANGUAGES ] ;
97112
98- initPhp ( ) ;
99113 initVendorWatchers ( ) ;
100114 watchForComposerChanges ( ) ;
101115 setParserBinaryPath ( context ) ;
@@ -104,8 +118,6 @@ export async function activate(context: vscode.ExtensionContext) {
104118
105119 updateDiagnostics ( vscode . window . activeTextEditor ) ;
106120
107- context . subscriptions . push ( ) ;
108-
109121 const delegatedRegistry = new Registry (
110122 ...completionProviders ,
111123 new EloquentCompletion ( ) ,
@@ -194,16 +206,6 @@ export async function activate(context: vscode.ExtensionContext) {
194206 providedCodeActionKinds : [ vscode . CodeActionKind . QuickFix ] ,
195207 } ,
196208 ) ,
197- vscode . commands . registerCommand ( "laravel.open" , openFileCommand ) ,
198- vscode . commands . registerCommand ( "laravel.runPint" , runPint ) ,
199- vscode . commands . registerCommand (
200- "laravel.runPintOnCurrentFile" ,
201- runPintOnCurrentFile ,
202- ) ,
203- vscode . commands . registerCommand (
204- "laravel.runPintOnDirtyFiles" ,
205- runPintOnDirtyFiles ,
206- ) ,
207209 ) ;
208210
209211 collectDebugInfo ( ) ;
0 commit comments