Shopify / ruby-lsp-rails

A Ruby LSP addon for Rails
https://shopify.github.io/ruby-lsp/rails-addon
MIT License
551 stars 25 forks source link

"Jump to view" includes folders as well #463

Open shnikola opened 4 hours ago

shnikola commented 4 hours ago

Description

Ruby LSP Information

Ruby LSP Information

VS Code Version

1.93.1

Ruby LSP Extension Version

0.8.1

Ruby LSP Server Version

0.18.3

Ruby LSP Addons

Ruby Version

3.2.5

Ruby Version Manager

rbenv

Installed Extensions

Click to expand - copilot (1.233.0) - copilot-chat (0.20.3) - haml (1.4.1) - rainbow-csv (3.12.0) - ruby-lsp (0.8.1)

Ruby LSP Settings

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

Reproduction steps

  1. Start the Ruby LSP using VS Code
  2. Open a Rails controller file (e.g. posts). Choose an action (e.g. show) which has a "Jump to View" option.
  3. If views/posts/ has a show directory inside it, it will be offered as a possible view, even though it's a folder.

Folders should be skipped when collecting possible views of a Rails action.

andyw8 commented 3 hours ago

Thanks, https://github.com/Shopify/ruby-lsp-rails/pull/464 should solve this.