TheColorRed / vscode-laravel-artisan

Visual Studio Code Laravel Artisan Extension
https://marketplace.visualstudio.com/items?itemName=ryannaddy.laravel-artisan
68 stars 19 forks source link

Display Panel always shows "Loading Route Information..." #102

Closed mac-s-g closed 1 year ago

mac-s-g commented 1 year ago

hey, thanks for all the work you've shared with the vscode+laravel community.

I recently installed the extension within a vscode devcontainer.

when invoking commands through the extension, the display panel only shows "Loading Route Information...".

image

the terminal output looks good (for example, "Artisan: Migrate Status" successfully runs migrate:status and displays migrations in my terminal), and the extension doesn't output any errors.

here's a video showing the issue in a little more detail: https://github.com/TheColorRed/vscode-laravel-artisan/assets/4097374/ede73f71-c07b-4025-b76c-1b689fa059f0

do you have any ideas on how to debug?

thanks for your help!

TheColorRed commented 1 year ago

When I run that command in the terminal it takes a while. How long does it take for you to manually run the command artisan route:list --json?

mac-s-g commented 1 year ago

thanks for the quick reply.
takes about a second running in the terminal. a little bit longer to see json in the output panel when i invoke the command with the extension.
the video is a little misleading. i've left those display panels open for extended periods of time (10 mins or so) and the display doesn't update.

AaronLil commented 1 year ago

This behavior is really annoying, especially when checking routes, as it keeps repeating to update the real-time listing.

I investigated, and the problem is in the Common.js at: https://github.com/TheColorRed/vscode-laravel-artisan/blob/42c6c2ec9fdec6e994d586b16b335949a5f199ac/src/Common.ts#L129

This line of code forces the display of the output panel/channel for any message, and I believe the correct behavior should be to only open the panel for error messages (as it happens a few lines below) or something relevant to the command we are executing.

I made a pull request removing this line of code. But in my opinion, this option could be configurable if displaying logs is really important for the extension.

AaronLil commented 1 year ago

I just realized that this issue has nothing to do with the pull request I made, which only fixes the unnecessary display and focus gain of the output panel. Please disregard my previous message.

uwla commented 1 year ago

Here is a temporary workaround:

Modify the route/List file to the following:

this.subscription = this.observable.subscribe();
setTimeout(() => this.subscription.unsubscribe(), 2000); // add this line

Change the default observer time from 5000ms to 1000ms.This gives enough time to load the routes and will run php artisan route:list only once or twice before the subscription is cancelled by the timeout handler.

Also, if you don't like the Laravel Artisan panel from popping up, comment the outputConsole.show() in utils/Output.

Effectly, this workaround requires you to manually change the extension. This is not the proper way to fix the undesirable behavior, but it does work.

github-actions[bot] commented 1 year ago

Marking issue as stale since there has'nt been any activity recently.