emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/treesit-fold 809bc9a0db 090/417: Remove go decalaration


From: ELPA Syncer
Subject: [nongnu] elpa/treesit-fold 809bc9a0db 090/417: Remove go decalaration
Date: Mon, 1 Jul 2024 10:02:14 -0400 (EDT)

branch: elpa/treesit-fold
commit 809bc9a0db75dff5df39156ad6839575a6b6a348
Author: Jen-Chieh Shen <jcs090218@gmail.com>
Commit: Jen-Chieh Shen <jcs090218@gmail.com>

    Remove go decalaration
---
 tree-sitter-fold.el | 29 -----------------------------
 1 file changed, 29 deletions(-)

diff --git a/tree-sitter-fold.el b/tree-sitter-fold.el
index 7fe2d368ca..ddd5bffd1f 100644
--- a/tree-sitter-fold.el
+++ b/tree-sitter-fold.el
@@ -338,35 +338,6 @@ If the current syntax node is not foldable, do nothing."
       (tree-sitter-fold-range-seq node (cons 1 -1))
     nil))
 
-(defun tree-sitter-fold-range-go-type-declaration (node offset)
-  "Return the fold range for `type_declaration' NODE.
-Only `struct_type' and `interface_type' nodes can be folded."
-  (when-let* ((type-spec-node (tsc-get-nth-child node 1))
-              ;; the type_spec node is not named in the Go grammar
-              ;; so ensure that the 1-th child is a type_spec node
-              ((eq (tsc-node-type type-spec-node) 'type_spec))
-              (type-node (tsc-get-child-by-field type-spec-node :type))
-              (type-node-type (tsc-node-type type-node)))
-    (cond
-     ;; only struct and interface types can be folded
-     ((or (eq type-node-type 'struct_type)
-          (eq type-node-type 'interface_type))
-      ;; find the end of the "struct" or "interface" keyword
-      (let ((beg (1+ (tsc-node-end-position (tsc-get-nth-child type-node 0))))
-            (end (tsc-node-end-position node)))
-        (setq beg (+ beg (car offset)) end (+ end (cdr offset)))
-        (cons beg end)))
-     (t nil))))
-
-(defun tree-sitter-fold-range-go-method (node offset)
-  "Return the fold range for `method_declaration' NODE."
-  (let* ((named-node (or (tsc-get-child-by-field node :result)
-                         (tsc-get-child-by-field node :parameters)))
-         (beg (1+ (tsc-node-end-position named-node)))
-         (end (tsc-node-end-position node)))
-    (setq beg (+ beg (car offset)) end (+ end (cdr offset)))
-    (cons beg end)))
-
 (defun tree-sitter-fold-range-nix-function (node offset)
   "Return the fold range for `function' NODE."
   (let ((beg (thread-first node



reply via email to

[Prev in Thread] Current Thread [Next in Thread]