summaryrefslogtreecommitdiff
path: root/lisp/progmodes/csharp-mode.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/progmodes/csharp-mode.el')
-rw-r--r--lisp/progmodes/csharp-mode.el17
1 files changed, 5 insertions, 12 deletions
diff --git a/lisp/progmodes/csharp-mode.el b/lisp/progmodes/csharp-mode.el
index 55ae7db714b..3e07da40cdd 100644
--- a/lisp/progmodes/csharp-mode.el
+++ b/lisp/progmodes/csharp-mode.el
@@ -35,19 +35,12 @@
(require 'cc-langs)
(require 'treesit)
(require 'c-ts-common) ; For comment indenting and filling.
+(treesit-declare-unavailable-functions)
(eval-when-compile
(require 'cc-fonts)
(require 'rx))
-(declare-function treesit-parser-create "treesit.c")
-(declare-function treesit-induce-sparse-tree "treesit.c")
-(declare-function treesit-node-start "treesit.c")
-(declare-function treesit-node-type "treesit.c")
-(declare-function treesit-node-child-by-field-name "treesit.c")
-(declare-function treesit-query-capture "treesit.c")
-(declare-function treesit-query-compile "treesit.c")
-
(defgroup csharp nil
"Major mode for editing C# code."
:group 'prog-mode)
@@ -342,7 +335,7 @@
;; Chained identifiers in using/namespace statements
,`(,(c-make-font-lock-search-function
csharp--regex-using-or-namespace
- `((csharp--color-forwards font-lock-variable-name-face)
+ `((csharp--color-forwards 'font-lock-variable-name-face)
nil
(goto-char (match-end 0)))))
@@ -355,7 +348,7 @@
;; Single identifier in attribute
(eval . (list (concat "\\[" csharp--regex-type-name-matcher "\\][^;]")
- 1 font-lock-variable-name-face t))
+ 1 'font-lock-variable-name-face t))
;; Function names
(eval . (list "\\([A-Za-z0-9_]+\\)\\(<[a-zA-Z0-9, ]+>\\)?("
@@ -368,7 +361,7 @@
(eval . (list (concat "\\<nameof\\> *( *"
csharp--regex-identifier-matcher
" *) *")
- 1 font-lock-variable-name-face))
+ 1 'font-lock-variable-name-face))
;; Catch statements with type only
(eval . (list (concat "\\<catch\\> *( *"
@@ -1049,7 +1042,7 @@ Key bindings:
(error "Tree-sitter for C# isn't available"))
;; Tree-sitter.
- (treesit-parser-create 'c-sharp)
+ (setq treesit-primary-parser (treesit-parser-create 'c-sharp))
;; Comments.
(c-ts-common-comment-setup)