Skip to content

No way to enable or disable language support without editing Lua source files #164

@ooloth

Description

@ooloth

Current state

Language-specific configurations in lua/config/plugins/lang/ are auto-loaded for every file that exists in that directory. A user who does not work in Go, Svelte, or C cannot opt out without deleting files or commenting out Lua code — there is no configuration layer between "file exists" and "language is active." This means LSP servers, formatters, and linters start for languages the user never uses.

Ideal state

  • Users can control which language files are active via an environment variable or a lightweight config file (e.g. ~/.config/nvim/languages.json or NVIM_LANGUAGES=python,typescript,rust).
  • Language files not in the active set are not loaded at startup.
  • Adding or removing a language does not require editing any Lua source file.
  • The mechanism is documented in the README so a new user can customise their stack on first setup.

Out of scope

  • Auto-detecting active languages from installed tools — manual opt-in is sufficient.
  • Changing the auto-load mechanism itself (require_all_files_in_config_directory) beyond adding a filter step.

Starting points

  • lua/config/plugins/languages.lua — calls require_all_files_in_config_directory; the filter step belongs here
  • lua/config/util/init.lua — the loader utility that could be extended to accept an allowlist
  • lua/config/plugins/lang/ — the files being unconditionally loaded today

QA plan

  1. Configure the system to exclude Go (e.g. omit it from the active-languages list).
  2. Start Neovim headlessly (nvim --headless -c "qall") — expect no errors.
  3. Open a .go file — expect no Go LSP, formatter, or linter activity.
  4. Re-add Go to the active set and open a .go file — expect normal Go LSP startup.
  5. Open a Python file — expect Python tooling to be unaffected by the Go change (no regression).

Done when

A user can remove a language from their active set without editing any Lua source file, and that language's LSP and tooling do not start when Neovim opens.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions