-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Migrations are pending" popup is too aggressive #540
Comments
Hi Matt, thank you for the suggestion. We will consider some options for this. |
@swanson We discussed as a team and are considering this approach: We won't prompt to run the migrations if the most recent migration is empty. A migration would be considered empty if it has no methods:
or if it contains only a timestamp column (which the generator may add by default).
If were were do this, I don't think we wouldn't need an option to disable the popup. The only downside I can think of is if you save the migration mid-way through writing it, then it would trigger the popup. Any thoughts? |
If I run the output is
so I don't think that would solve my particular issue because the LSP would not consider that empty, correct? |
Maybe "smart detection of empty migrations" is not the right solution, but it does seem like people (myself included) will want a way to turn off this popup, as it is pretty invasive if you aren't using it. The Rails "run pending migration" button is also an option so I don't believe this functionality is novel enough to be "always on". |
We can have it treat that as empty too. |
This is also an annoyance for me. #553 is an improvement I suppose, but it still seems like a half measure. What if the popup also included a button to open/edit the pending migration files? That would actually be useful immediately after running |
@swanson do you think that would be helpful? I would also prefer that over checking timestamps. |
I use https://marketplace.visualstudio.com/items?itemName=tmikoss.rails-latest-migration so it wouldn't be something I would use. I can currently (without the LSP at all), run Personally, I still think an option to completely disable this would be my preference. I've not used it once, I use the built-in Rails "run pending migrations" button if there are new migrations from a merge that I am missing. And every time I generate a migration, it is popping up and I have to dismiss. |
Hi, I appreciate the intension with the migration pending popup, but as @swanson mentioned it's really aggressive to the point that it's getting in the way of development. Also adding that rails in development mode errors and reminds you that there are pending migration, so it would be ideal to have this configurable to be disabled. |
As an additional thought, having to an option to dismiss and don't be reminded of migrations for the latest pending migration would be a decent step in the right direction. However this should be in addition to being able to disable the reminder all together. |
We discussed among the team and decided to allow disabling the dialog #570. It's easier than trying to detect what the user intention or preference is.
The server can't modify the user's settings, so that would require the Ruby LSP to start allowing settings to be stored in some file database. That would also create an extra level of setting hierarchy, since editors like VS Code allow for user and workspace settings, but then we would additionally have the Ruby LSP's own setting store, which starts getting overly complicated. If the LSP specification were to formalize a way for servers to suggest or prompt users to modify their settings, that would lead to a better experience and significantly less complicated implementation. |
Closes #540 Allow disabling the pending migration prompt through an addon setting. To disable, users can add this to their configuration: ```json "rubyLsp.addonSettings": { "Ruby LSP Rails": { "enablePendingMigrationsPrompt": false } } ```
I often am running
bin/rails g migration SomeMigration
to get a blank migration and then writing it my editor instead of the generator. When I do this, the "Migrations are pending" popup immediately displays and asks me to run the (empty) migration.From my perspective:
I think this has the potential for people to run the empty migration without realizing it ("I just click that button always") and then write the actual migration code and be confused why the changes don't seem to work (migration was marked as run so it doesnt re-run)
The text was updated successfully, but these errors were encountered: