Description
Description
Ruby LSP Information
VS Code Version
1.95.0
Ruby LSP Extension Version
0.8.12
Ruby LSP Server Version
0.21.3
Ruby LSP Addons
- Ruby LSP Rails
Ruby Version
3.1.6
Ruby Version Manager
rbenv
Installed Extensions
Click to expand
- gitlens (15.6.2)
- java (1.36.0)
- makefile-tools (0.11.13)
- remote-containers (0.388.0)
- ruby-extensions-pack (0.1.12)
- ruby-lsp (0.8.12)
- test-adapter-converter (0.2.1)
- vscode-docker (1.29.3)
- vscode-github-actions (0.27.0)
- vscode-gradle (3.16.4)
- vscode-java-debug (0.58.1)
- vscode-java-dependency (0.24.0)
- vscode-java-pack (0.29.0)
- vscode-maven (0.44.0)
- vscode-rdbg (0.2.2)
- vscode-ruby-test-adapter (0.9.2)
- vscode-test-explorer (2.22.1)
Ruby LSP Settings
Click to expand
Workspace
{}
User
{
"enableExperimentalFeatures": false,
"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": "auto"
},
"customRubyCommand": "",
"formatter": "rubocop",
"linters": null,
"bundleGemfile": "",
"testTimeout": 30,
"branch": "",
"pullDiagnosticsOn": "both",
"useBundlerCompose": false,
"bypassTypechecker": false,
"rubyExecutablePath": "",
"indexing": {
"excludedPatterns": [
"node_modules/**/*",
"tmp/**/*",
"spec/**/*_spec.rb",
"db/**/*",
"factories/**/*",
"script/**/*"
]
},
"erbSupport": true,
"useLauncher": false
}
Reproduction steps
While it's possible to specify includePatterns
and excludePatterns
for rubyLsp.indexing
, those values are concatenated to the default values for those settings. That makes it impossible to configure ruby-lsp
to index RSpec support files.
For example, RSpec will add spec
to $LOAD_PATH
, so we can add some support file to spec/my_helper_module.rb
, for example, and include that module in a context. Here's an example on how it works:
module LoggedInAsAdmin
extend RSpec::Core::SharedContext
before(:example) do
log_in_as :admin
end
end
describe "admin section" do
include LoggedInAsAdmin
# ...
end
In the example above, LoggedInAsAdmin
is not going to be indexed, so we can't jump to its definition from VSCode.
Currently, it's not possible to override the exclusion pattern "spec/**/*" defined by default, from VSCode settings.
We should be allowed to override those exclusions in order to enable indexing of RSpec support files.