Skip to content

Commit 7002042

Browse files
author
Parker Settle
committed
feat(nix): add Nix language support for nested scope detection
- Add nix.lua with Nix-specific treesitter node types - Enables chunk indicators for let expressions, attrsets, lambdas, etc. - Provides better visual feedback for Nix flake structure This allows hlchunk to show arrows/indicators for all nested scopes in Nix files (inputs, outputs, let blocks, attribute sets, etc.) instead of just top-level scopes.
1 parent 0d58d4e commit 7002042

2 files changed

Lines changed: 18 additions & 0 deletions

File tree

lua/hlchunk/utils/ts_node_type/init.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ local M = {}
33
M.cpp = require("hlchunk.utils.ts_node_type.cpp")
44
M.css = require("hlchunk.utils.ts_node_type.css")
55
M.lua = require("hlchunk.utils.ts_node_type.lua")
6+
M.nix = require("hlchunk.utils.ts_node_type.nix")
67
M.rust = require("hlchunk.utils.ts_node_type.rust")
78
M.yaml = require("hlchunk.utils.ts_node_type.yaml")
89
M.zig = require("hlchunk.utils.ts_node_type.zig")
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
-- Nix-specific treesitter node types for hlchunk
2+
-- Covers: let expressions, attribute sets, lambda functions, with expressions, etc.
3+
-- Format: node_type = true (table with keys, not array)
4+
return {
5+
let_expression = true, -- let ... in ...
6+
attrset_expression = true, -- { ... }
7+
rec_attrset_expression = true, -- rec { ... }
8+
list_expression = true, -- [ ... ]
9+
lambda_expression = true, -- arg: body
10+
function_expression = true, -- { args }: body
11+
with_expression = true, -- with ...; ...
12+
if_expression = true, -- if ... then ... else ...
13+
assert_expression = true, -- assert ...; ...
14+
binding = true, -- name = value;
15+
inherit = true, -- inherit ...;
16+
inherit_from = true, -- inherit (...) ...;
17+
}

0 commit comments

Comments
 (0)