1{
2 lib,
3 fetchFromGitHub,
4 buildPythonPackage,
5 rustPlatform,
6 cargo,
7 rustc,
8 setuptools,
9 tree-sitter,
10 pytestCheckHook,
11}:
12
13buildPythonPackage rec {
14 pname = "tree-sitter-c-sharp";
15 version = "0.23.1";
16 pyproject = true;
17
18 src = fetchFromGitHub {
19 owner = "tree-sitter";
20 repo = "tree-sitter-c-sharp";
21 tag = "v${version}";
22 hash = "sha256-weH0nyLpvVK/OpgvOjTuJdH2Hm4a1wVshHmhUdFq3XA=";
23 };
24
25 cargoDeps = rustPlatform.fetchCargoVendor {
26 inherit src;
27 hash = "sha256-IogdMRj1eHRLtdNFdGNInpEQAAbRpM248GqkY+Mgu10=";
28 };
29
30 build-system = [
31 cargo
32 rustPlatform.cargoSetupHook
33 rustc
34 setuptools
35 ];
36
37 optional-dependencies = {
38 core = [
39 tree-sitter
40 ];
41 };
42
43 pythonImportsCheck = [ "tree_sitter_c_sharp" ];
44
45 nativeCheckInputs = [
46 pytestCheckHook
47 tree-sitter
48 ];
49
50 meta = {
51 description = "C# Grammar for tree-sitter";
52 homepage = "https://github.com/tree-sitter/tree-sitter-c-sharp";
53 license = lib.licenses.mit;
54 maintainers = with lib.maintainers; [ yzx9 ];
55 };
56}