Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

exclude gems based on pattern/prefix name/wildcard #2847

Open
1 task done
will opened this issue Nov 12, 2024 · 2 comments
Open
1 task done

exclude gems based on pattern/prefix name/wildcard #2847

will opened this issue Nov 12, 2024 · 2 comments
Labels
enhancement New feature or request help-wanted Extra attention is needed

Comments

@will
Copy link

will commented Nov 12, 2024

I have checked that this feature is not already implemented

  • This feature does not exist

Use case

There are large families of gems that are just generated api code that both take a long time to index, and aren't worth indexing. Manually enumerating them once wasn't so bad, but I just had a reason to add Yet Another Aws Gem and it's not fun to have to remember to exclude it.

Description

Right now my config is

  vim.lsp.start {
    name = "ruby-lsp",
    cmd = { "ruby-lsp" },
    root_dir = root_dir,
    init_options = {
      formatter = "standard",
      linters = { "standard" },
      indexing = {
        -- stylua: ignore start
        excludedGems = {
          "aws-eventstream", "aws-partitions", "aws-sdk-cloudwatch", "aws-sdk-cloudwatchlogs", "aws-sdk-core",
          "aws-sdk-ec2", "aws-sdk-elasticloadbalancingv2", "aws-sdk-kms", "aws-sdk-route53", "aws-sdk-s3", "aws-sdk-iam",
          "aws-sigv4", "google-apis-compute_v1", "google-apis-core", "google-apis-dns_v1",
          "google-apis-iam_v1", "google-apis-iamcredentials_v1", "google-apis-storage_v1", "google-cloud-core",
          "google-cloud-env", "google-cloud-errors", "google-cloud-storage", "opentelemetry-api",
          "opentelemetry-common", "opentelemetry-helpers-sql-obfuscation", "opentelemetry-instrumentation-aws_sdk",
          "opentelemetry-instrumentation-base", "opentelemetry-instrumentation-excon", "opentelemetry-instrumentation-faraday",
          "opentelemetry-instrumentation-pg", "opentelemetry-instrumentation-rack", "opentelemetry-registry", "opentelemetry-sdk",
          "opentelemetry-semantic_conventions",
        },
        -- stylua: ignore end
      },
    },
  }

But I would like it to be like

  vim.lsp.start {
    name = "ruby-lsp",
    cmd = { "ruby-lsp" },
    root_dir = root_dir,
    init_options = {
      formatter = "standard",
      linters = { "standard" },
      indexing = { excludedGems = { "aws-*", "google-*",  "opentelemetry-*" } },
    },
  }

or something along those lines

Implementation

No response

@will will added the enhancement New feature or request label Nov 12, 2024
Copy link
Contributor

This issue is being marked as stale because there was no activity in the last 2 months

@github-actions github-actions bot added the Stale label Jan 12, 2025
@vinistock vinistock removed the Stale label Jan 14, 2025
@vinistock
Copy link
Member

Thank you for the feature suggestion! We're open to having this possibility, but we can't prioritize it at the moment. If someone is interested in working on this, but aren't sure where to start, just reach out and we can help.

Note: we may be able to implement this with File.fnmatch?, which can check glob patterns against file paths and returns a boolean.

@vinistock vinistock added the help-wanted Extra attention is needed label Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help-wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants