Unverified Commit cf497a82 authored by Yt's avatar Yt Committed by GitHub
Browse files

{python3Packages.textual,tree-sitter.grammars}: unbreak (#428417)

parents 1733b682 b6554c9f
Loading
Loading
Loading
Loading
+0 −21
Original line number Diff line number Diff line
diff --git a/aider/repomap.py b/aider/repomap.py
index 23eee239..0a40f2e6 100644
--- a/aider/repomap.py
+++ b/aider/repomap.py
@@ -16,6 +16,7 @@ from grep_ast import TreeContext, filename_to_lang
 from pygments.lexers import guess_lexer_for_filename
 from pygments.token import Token
 from tqdm import tqdm
+from tree_sitter import QueryCursor
 
 from aider.dump import dump
 from aider.special import filter_important_files
@@ -286,7 +287,7 @@ class RepoMap:
 
         # Run the tags queries
         query = language.query(query_scm)
-        captures = query.captures(tree.root_node)
+        captures = QueryCursor(query).captures(tree.root_node)
 
         saw = set()
         if USING_TSL_PACK:
+0 −2
Original line number Diff line number Diff line
@@ -146,8 +146,6 @@ let
    ];

    patches = [
      ./fix-tree-sitter.patch

      (replaceVars ./fix-flake8-invoke.patch {
        flake8 = lib.getExe python3Packages.flake8;
      })
+0 −2
Original line number Diff line number Diff line
@@ -95,7 +95,5 @@ buildPythonPackage rec {
    changelog = "https://github.com/Textualize/textual/blob/${src.tag}/CHANGELOG.md";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ gepbird ];
    # https://github.com/Textualize/textual/issues/5868
    broken = true;
  };
}
+2 −2
Original line number Diff line number Diff line
@@ -8,14 +8,14 @@

buildPythonPackage rec {
  pname = "tree-sitter-rust";
  version = "0.24.0";
  version = "0.23.2";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "tree-sitter";
    repo = "tree-sitter-rust";
    tag = "v${version}";
    hash = "sha256-y3sJURlSTM7LRRN5WGIAeslsdRZU522Tfcu6dnXH/XQ=";
    hash = "sha256-aT+tlrEKMgWqTEq/NHh8Vj92h6i1aU6uPikDyaP2vfc=";
  };

  build-system = [
+12 −27
Original line number Diff line number Diff line
@@ -2,8 +2,7 @@
  lib,
  stdenv,
  buildPythonPackage,
  fetchFromGitHub,
  pytestCheckHook,
  fetchPypi,
  pythonOlder,
  setuptools,
  tree-sitter-python,
@@ -15,17 +14,14 @@

buildPythonPackage rec {
  pname = "tree-sitter";
  version = "0.24.0-unstable-2025-06-02";
  version = "0.24.0";
  pyproject = true;

  disabled = pythonOlder "3.10";

  src = fetchFromGitHub {
    owner = "tree-sitter";
    repo = "py-tree-sitter";
    rev = "9c78f3b8d10f81b97fbb2181c9333323d6375480";
    hash = "sha256-jPqTraGrYFXBlci4Zaleyp/NTQhvuI39tYWRckjnV2E=";
    fetchSubmodules = true;
  src = fetchPypi {
    inherit pname version;
    hash = "sha256-q9la9lyi9Pfso1Y0M5HtZp52Tzd0i1NSlG8A9/x45zQ=";
  };

  # see https://github.com/tree-sitter/py-tree-sitter/issues/330#issuecomment-2629403946
@@ -36,7 +32,6 @@ buildPythonPackage rec {
  build-system = [ setuptools ];

  nativeCheckInputs = [
    pytestCheckHook
    tree-sitter-python
    tree-sitter-rust
    tree-sitter-html
@@ -56,20 +51,10 @@ buildPythonPackage rec {
    "test_dot_graphs"
  ];

  meta =
    let
      # for an -unstable version, we grab the release notes for the last tagged
      # version it is based upon
      lastTag = lib.pipe version [
        lib.splitVersion
        (lib.take 3)
        (lib.concatStringsSep ".")
      ];
    in
    {
  meta = {
    description = "Python bindings to the Tree-sitter parsing library";
    homepage = "https://github.com/tree-sitter/py-tree-sitter";
      changelog = "https://github.com/tree-sitter/py-tree-sitter/releases/tag/v${lastTag}";
    changelog = "https://github.com/tree-sitter/py-tree-sitter/releases/tag/v${version}";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ fab ];
  };
Loading