Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions EDITORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,3 +205,19 @@ You can use the Ruby LSP with RubyMine (or IntelliJ IDEA Ultimate) through the f
Note that there might be overlapping functionality when using it with RubyMine, given that the IDE provides similar features as the ones coming from the Ruby LSP.

[Ruby LSP plugin](https://plugins.jetbrains.com/plugin/24413-ruby-lsp)

# Indexing Configuration

To configure indexing, pass a JSON hash as part of the initialization options for your editor, for example:

```json
{
"indexing": {
"excludedPatterns": ["**/test/**.rb"],
"includedPatterns": ["**/bin/**"],
"excludedGems": ["rubocop", "rubocop-performance"],
"includedPatterns": ["rake"],
"excludedMagicComments": ["compiled:true"]
}
}
```
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,12 @@ default gems, except for
- Gems that only appear under the `:development` group
- All Ruby files under `test/**/*.rb`

By creating a `.index.yml` file, these configurations can be overridden and tuned. Note that indexing dependent behavior, such as definition, hover, completion or workspace symbol will be impacted by the configurations placed here.
This behaviour can be overridden and tuned. Learn how to configure it [for VS Code](vscode/README.md#Indexing-Configuration) or [for other editors](EDITORS.md#Indexing-Configuration).

Note that indexing-dependent behavior, such as definition, hover, completion or workspace symbol will be impacted by
the configuration changes.

The older approach of using a `.index.yml` file has been deprecated and will be removed in a future release.

```yaml
# Exclude files based on a given pattern. Often used to exclude test files or fixtures
Expand Down
8 changes: 5 additions & 3 deletions lsp.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@
"**/out": true,
},
"rubyLsp.bypassTypechecker": true,
"rubyLsp.excludedPatterns": [
"**/test/fixtures/**/*.rb"
],
"rubyLsp.indexing": {
"excludedPatterns": [
"**/test/fixtures/**/*.rb"
],
},
"typescript.tsc.autoDetect": "off",
}
}
17 changes: 17 additions & 0 deletions vscode/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -440,3 +440,20 @@ When `rubyLsp.formatter` is set to `auto`, Ruby LSP tries to determine which for
If the bundle has a **direct** dependency on a supported formatter, such as `rubocop` or `syntax_tree`, that will be used.
Otherwise, formatting will be disabled and you will need add one to the bundle. Using globally installed formatters or
linters is not supported, they must in your Gemfile or gemspec.

## Indexing Configuration

To configure indexing, pass a JSON hash as part of the Ruby LSP configuration, for example:

```jsonc
// PROJECT/.vscode/settings.json
{
"rubyLsp.indexing": {
"excludedPatterns": ["**/test/**.rb"],
"includedPatterns": ["**/bin/**"],
"excludedGems": ["rubocop", "rubocop-performance"],
"includedPatterns": ["rake"],
"excludedMagicComments": ["compiled:true"],
},
}
```