feat(nix): add Nix language support for nested scope detection #179
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Adds Nix-specific treesitter node types for better chunk indicator support in Nix files.
Problem
Currently, hlchunk only shows chunk indicators for top-level scopes in Nix files. Nix has many nested scope types (let expressions, attribute sets, lambda functions, etc.) that weren't being detected.
Solution
Add
nix.luawith Nix-specific treesitter node types as a table (not array):let_expression-let ... in ...blocksattrset_expression-{ ... }attribute setsrec_attrset_expression-rec { ... }recursive setslist_expression-[ ... ]listslambda_expression-arg: bodyfunctionsfunction_expression-{ args }: bodyfunctionswith_expression-with ...; ...expressionsif_expression- conditionalsassert_expression- assertionsbinding-name = value;bindingsBenefits
Better visual feedback when editing Nix flakes and configurations. Users can now see chunk indicators for:
Especially useful for NixOS configurations and flake structures.
Testing
Tested on NixOS with Nix flakes and configuration files. Chunk indicators now appear for all nested scopes.