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

Add a way to exclude files from indexing #1574

Open
gergaly opened this issue Jan 7, 2025 · 0 comments
Open

Add a way to exclude files from indexing #1574

gergaly opened this issue Jan 7, 2025 · 0 comments

Comments

@gergaly
Copy link

gergaly commented Jan 7, 2025

Is your feature request related to a problem? Please describe.
In our project there are a couple of platforms to build and release. And the erlang modules are organized something like this:

  1. src/foo.erl, containing all common code.
  2. src/platformA/foo_spec.erl, containing all platform A specific code.
  3. src/platformB/foo_spec.erl, containing all platform B specific code.
  4. and so on

The foo_spec modules are containing the same functions with the same signatures but they are working different as required by their respective platforms. The erlang_ls language server parses and indexes all of the _spec modules which makes code navigation (go to definition or references) painful or impossible.
The project does not use rebar or erlang.mk files. The build system is based on bob and bazel.

Describe the solution you'd like
I'd like to start the erlang_ls server in a platform specific mode by adding a different config_path option via InitOptions for each platform. This is already working. And I would like to have an 'excludes' option in the erlang_ls.config file so paths and files matching these exclude patterns are not parsed and indexed.

Describe alternatives you've considered
I've added each and every include directory to the include_dirs config option without wildcards. But I can't do that with application files because they are searched recursively.

Additional context
I've already made a working prototype with the following examples:

  • erlang_ls.config for platform A:
excludes:
  - platformB
  - platformC
  • erlang_ls.config for platform B:
excludes:
  - platformA
  - platformC

I don't know if my solution is ready for a PR or not, but here it is:
main...gergaly:erlang_ls:excludes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant