ruby-lsp: Incorrect ancestor linearization for re-opens that omit the parent class
Description
Ruby LSP Information
VS Code Version
1.100.2
Ruby LSP Extension Version
0.9.25
Ruby LSP Server Version
0.23.21
Ruby LSP Add-ons
- Standard Ruby
- Ruby LSP Rails
- RuboCop
Ruby Version
3.4.4
Ruby Version Manager
asdf
Installed Extensions
Click to expand
- codesnap (1.3.4)
- copilot (1.322.0)
- copilot-chat (0.27.1)
- explorer (1.18.1)
- gitlens (17.1.0)
- indent-rainbow (8.3.1)
- prettier-vscode (11.0.0)
- ruby-lsp (0.9.25)
- vscode-eslint (3.0.10)
- vscode-github-actions (0.27.1)
- vscode-pull-request-github (0.110.0)
- vscode-xml (0.29.0)
- vscode-yaml (1.18.0)
Ruby LSP Settings
Click to expand
Workspace
{
"formatter": "rubocop",
"linters": [
"rubocop"
]
}
User
{
"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": true,
"definition": true,
"workspaceSymbol": true,
"signatureHelp": true,
"typeHierarchy": true
},
"featuresConfiguration": {},
"addonSettings": {},
"rubyVersionManager": {
"identifier": "asdf"
},
"customRubyCommand": "",
"formatter": "rubocop",
"linters": [
"rubocop"
],
"bundleGemfile": "",
"testTimeout": 30,
"branch": "",
"pullDiagnosticsOn": "both",
"useBundlerCompose": false,
"bypassTypechecker": false,
"rubyExecutablePath": "",
"indexing": {},
"erbSupport": true,
"featureFlags": {
"all": true
},
"sigOpacityLevel": "1"
}
Reproduction steps
- Start VS Code, updated to the
0.9.25extension - Open a test file inheriting from
ActionDispatch::IntegrationTest - No
Run | Run in terminal | Debugavailable - In
Testingtab all ruby tests are listed as@hidden
- If I downgrade to 0.9.24 it is the same thing, but on 0.9.23 it works again.
- It works if I open a test that inherits from
ActiveSupport::TestCaseorApplicationSystemTestCase
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 1
- Comments: 18 (5 by maintainers)
but lenses do not appear on integration tests in
test/controllers/something_test.rbhavingclass SomethingTest < ActionDispatch::IntegrationTest.The test explorer does not have any test listed under the correspondent test file - still having the test file in list.
Nothing I’d consider to report from the output panel.
Ruby LSP Information
VS Code Version
1.100.2
Ruby LSP Extension Version
0.9.26
Ruby LSP Server Version
0.23.23
Ruby LSP Add-ons
Ruby Version
3.3.7
Ruby Version Manager
rbenv
Installed Extensions
Click to expand
Ruby LSP Settings
Click to expand
Workspace
User
In order to keep working w/ same setup I’ve set
and it’s working the way was working before.
Worth noticing that re-opening rails classes that way is 100% documentation-driven: https://guides.rubyonrails.org/testing.html#test-helpers
Glad it helped and happy to see the patch in the wild. Thanks for your work and support.
Thanks for the information, it was really helpful. This is actually not directly related to our new explorer implementation, but instead a bug in linearization that will be fixed by https://github.com/Shopify/ruby-lsp/pull/3572.
This also worked in my case too at restoring the code lens
I added the script to the debug repo: https://github.com/davidwessman/debug_ruby_lsp/commit/6e59fb4bab59e6ef6ab967650b9a2ebe9a51fb57
I added some filtering and when I run it I do not get any files that end in
_test.rbin theindexable_uris.If I downgrade I still do not get those files indexed, but the test discovery still works.