[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/csharp-mode 1c2b9cb 442/459: Add more nodes to beginnin
From: |
ELPA Syncer |
Subject: |
[elpa] externals/csharp-mode 1c2b9cb 442/459: Add more nodes to beginning/end-of-defun |
Date: |
Sun, 22 Aug 2021 14:00:18 -0400 (EDT) |
branch: externals/csharp-mode
commit 1c2b9cb51b6ecc8bf52d3f040b6c02639310a153
Author: Theodor Thornhill <theo@thornhill.no>
Commit: Theodor Thornhill <theo@thornhill.no>
Add more nodes to beginning/end-of-defun
I did not yet extract that list of declarations into a customizable
variable,
but I think that is a reasonable thing to do at some point.
Not completely sure how this should behave. Now tree-sitter defines things
as a
tree (obviously...), so we need to be able to jump to siblings as well.
Add more nodes to beginning/end-of-defun
I did not yet extract that list of declarations into a customizable
variable,
but I think that is a reasonable thing to do at some point.
Not completely sure how this should behave. Now tree-sitter defines things
as a
tree (obviously...), so we need to be able to jump to siblings as well.
---
csharp-tree-sitter.el | 21 +++++++++++++++++----
1 file changed, 17 insertions(+), 4 deletions(-)
diff --git a/csharp-tree-sitter.el b/csharp-tree-sitter.el
index 3518f8d..976519f 100644
--- a/csharp-tree-sitter.el
+++ b/csharp-tree-sitter.el
@@ -26,6 +26,7 @@
;;; Code:
(require 'cl-lib)
+(require 'cl-extra)
(require 'seq)
(require 'tree-sitter)
@@ -317,14 +318,26 @@
(defun csharp-beginning-of-defun ()
"Replacement-function for `beginning-of-defun' for
`csharp-tree-sitter-mode'."
(interactive)
- (when-let ((method (tree-sitter-node-at-point 'method_declaration)))
- (goto-char (tsc-node-start-position method))))
+ (when-let ((declaration
+ (cl-some (lambda (decl)
+ (tree-sitter-node-at-point decl))
+ '(method_declaration
+ constructor_declaration
+ class_declaration
+ namespace_declaration))))
+ (goto-char (tsc-node-start-position declaration))))
(defun csharp-end-of-defun ()
"Replacement-function for `end-of-defun' for `csharp-tree-sitter-mode'."
(interactive)
- (when-let ((method (tree-sitter-node-at-point 'method_declaration)))
- (goto-char (tsc-node-end-position method))))
+ (when-let ((declaration
+ (cl-some (lambda (decl)
+ (tree-sitter-node-at-point decl))
+ '(method_declaration
+ constructor_declaration
+ class_declaration
+ namespace_declaration))))
+ (goto-char (tsc-node-end-position declaration))))
(defun csharp-delete-method-at-point ()
"Deletes the method at point."
- [elpa] externals/csharp-mode 064f481 418/459: Fix autoload for tree-sitter support (#211), (continued)
- [elpa] externals/csharp-mode 064f481 418/459: Fix autoload for tree-sitter support (#211), ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 1de6556 422/459: Add base_list, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 1d02a54 424/459: Records and init-only fields, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 7d4af0d 425/459: Add with_expression, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 98a179a 427/459: Add dependencies to csharp-mode, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 6b232b1 429/459: Much better support for strings, interpolated in particular, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode c928423 435/459: Add generic property name, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode d272272 436/459: Add let keyword, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 43e5919 438/459: Prevent c-default-style error when set to string (#202), ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 6566964 440/459: Merge pull request #231 from emacs-csharp/bugfix/tree-sitter-crashes, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 1c2b9cb 442/459: Add more nodes to beginning/end-of-defun,
ELPA Syncer <=
- [elpa] externals/csharp-mode d942b27 441/459: Add tree-sitter based utility methods. (#232), ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode f977800 443/459: Add indentation settings for lambda functions (#229), ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 40c183e 452/459: Adjust wording in readme, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 2641599 454/459: Fix spectacular mis-edit of readme, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 26f1f8c 457/459: Add switch_expression, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 69fe52b 453/459: Version bump, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 0edf059 445/459: Fix ci (#234), ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode dd30649 459/459: Bump version, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 299d3f1 450/459: Don't require tree-sitter, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 27cd2e8 456/459: Align argument to siblings, ELPA Syncer, 2021/08/22