From 57355788d4dfafed03447fbba3ea49347fdc22b3 Mon Sep 17 00:00:00 2001 From: Vinicius Stock Date: Wed, 3 Jan 2024 10:46:37 -0300 Subject: [PATCH 1/2] Document index configuration file --- README.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/README.md b/README.md index 5a2497c56..11a39f263 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,36 @@ See the [documentation](https://shopify.github.io/ruby-lsp) for more in-depth de For creating rich themes for Ruby using the semantic highlighting information, see the [semantic highlighting documentation](SEMANTIC_HIGHLIGHTING.md). +### Configuring code indexing + +By default, the Ruby LSP indexes all Ruby files defined in the current project and all of its dependencies, including +default gems, except for + +- Gems that only appear under the development group +- All Ruby files under `test/**/*.rb` + +By creating an `.index.yml` file, these configurations can be overridden and tuned. + +```yaml +# Exclude files based on a given pattern. Often used to exclude test files or fixtures +excluded_patterns: + - "**/spec/**/*.rb" + +# Include files based on a given pattern. Can be used to index Ruby files that use different extensions +included_patterns: + - "**/bin/*" + +# Exclude gems by name. If a gem is never referenced in the project's code and is only used as a tool, excluding it will +# speed up indexing and reduce the amount of results in features like definition or completion +excluded_gems: + - rubocop + - pathname + +# Include gems by name. Normally used to include development gems that are excluded by default +included_gems: + - prism +``` + ### Addons The Ruby LSP provides an addon system that allows other gems to enhance the base functionality with more editor From baaf71fbc2360456ff7a3499adca170e5d635177 Mon Sep 17 00:00:00 2001 From: Vinicius Stock Date: Thu, 4 Jan 2024 09:42:36 -0300 Subject: [PATCH 2/2] Apply suggestions from code review Co-authored-by: Andy Waite <13400+andyw8@users.noreply.github.com> --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 11a39f263..35b0a96e4 100644 --- a/README.md +++ b/README.md @@ -51,10 +51,10 @@ documentation](SEMANTIC_HIGHLIGHTING.md). By default, the Ruby LSP indexes all Ruby files defined in the current project and all of its dependencies, including default gems, except for -- Gems that only appear under the development group +- Gems that only appear under the `:development` group - All Ruby files under `test/**/*.rb` -By creating an `.index.yml` file, these configurations can be overridden and tuned. +By creating a `.index.yml` file, these configurations can be overridden and tuned. ```yaml # Exclude files based on a given pattern. Often used to exclude test files or fixtures