Skip to content
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

Ruby LSP Rails prevents dropping the database by keeping an active connection #536

Open
mateusodd opened this issue Nov 22, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@mateusodd
Copy link

mateusodd commented Nov 22, 2024

Ruby LSP Information

VS Code Version

1.95.3

Ruby LSP Extension Version

0.8.13

Ruby LSP Server Version

0.22.1

Ruby LSP Addons

  • Ruby LSP Rails

Ruby Version

3.3.5

Ruby Version Manager

none

Installed Extensions

Click to expand
  • copilot (1.245.0)
  • copilot-chat (0.22.4)
  • gitlens (16.0.2)
  • ruby-lsp (0.8.13)
  • vscode-eslint (3.0.10)
  • vscode-pull-request-github (0.100.3)

Ruby LSP Settings

Click to expand
Workspace
{
  "rubyVersionManager": {
    "identifier": "none"
  }
}
User
{
  "enableExperimentalFeatures": true,
  "enabledFeatures": {
    "codeActions": true,
    "diagnostics": true,
    "documentHighlights": true,
    "documentLink": true,
    "documentSymbols": true,
    "foldingRanges": true,
    "formatting": true,
    "hover": true,
    "inlayHint": true,
    "onTypeFormatting": true,
    "selectionRanges": true,
    "semanticHighlighting": true,
    "completion": true,
    "codeLens": false,
    "definition": true,
    "workspaceSymbol": true,
    "signatureHelp": true,
    "typeHierarchy": true
  },
  "featuresConfiguration": {},
  "addonSettings": {},
  "rubyVersionManager": {
    "identifier": "none"
  },
  "customRubyCommand": "",
  "formatter": "auto",
  "linters": null,
  "bundleGemfile": "",
  "testTimeout": 30,
  "branch": "",
  "pullDiagnosticsOn": "both",
  "useBundlerCompose": false,
  "bypassTypechecker": false,
  "rubyExecutablePath": "",
  "indexing": {},
  "erbSupport": true,
  "useLauncher": false,
  "featureFlags": {}
}

Reproduction steps

  1. Open any Rails project with PostgreSQL database.
  2. Run the command bin/rails db:drop in the terminal.
  3. Observe the error message stating that the database cannot be dropped because it is being accessed by another user.
@mateusodd mateusodd added the bug Something isn't working label Nov 22, 2024
@andyw8 andyw8 transferred this issue from Shopify/ruby-lsp Nov 22, 2024
@andyw8
Copy link
Contributor

andyw8 commented Nov 22, 2024

This is expected because the Rails add-on would still have its Rails process active. I'm not sure how we could solve this, as we would to intercept that command and trigger the LSP to shutdown.

To workaround this for now, you should be able to stop Ruby LSP (Commmand-Shift-P then 'RubyLSP: Stop') before running db:drop.

@andyw8 andyw8 changed the title Ruby LSP prevents dropping the database by keeping an active connection Ruby LSP Rails prevents dropping the database by keeping an active connection Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants