Update csharp tree-sitter support due to upstream changes
A change in tree-sitter-c-sharp grammar for csharp (commit 18a531), has removed the keyword void_keyword and advised we should use predefined_type. * lisp/progmodes/csharp-mode.el (csharp-ts-mode--font-lock-settings): Support both old and new style of keywords in tree-sitter-c-sharp grammar. (Bug#65113)
This commit is contained in:
parent
556cb01b48
commit
78999d5213
1 changed files with 8 additions and 3 deletions
|
@ -816,7 +816,7 @@ compilation and evaluation time conflicts."
|
||||||
:language 'c-sharp
|
:language 'c-sharp
|
||||||
:feature 'definition
|
:feature 'definition
|
||||||
:override t
|
:override t
|
||||||
'((qualified_name (identifier) @font-lock-type-face)
|
`((qualified_name (identifier) @font-lock-type-face)
|
||||||
(using_directive (identifier) @font-lock-type-face)
|
(using_directive (identifier) @font-lock-type-face)
|
||||||
(using_directive (name_equals
|
(using_directive (name_equals
|
||||||
(identifier) @font-lock-type-face))
|
(identifier) @font-lock-type-face))
|
||||||
|
@ -843,8 +843,13 @@ compilation and evaluation time conflicts."
|
||||||
(class_declaration (identifier) @font-lock-type-face)
|
(class_declaration (identifier) @font-lock-type-face)
|
||||||
|
|
||||||
(constructor_declaration name: (_) @font-lock-type-face)
|
(constructor_declaration name: (_) @font-lock-type-face)
|
||||||
|
;;; Handle different releases of tree-sitter-c-sharp.
|
||||||
(method_declaration type: [(identifier) (void_keyword)] @font-lock-type-face)
|
;;; Check if keyword void_keyword is available, then return the correct rule."
|
||||||
|
,@(condition-case nil
|
||||||
|
(progn (treesit-query-capture 'csharp '((void_keyword) @capture))
|
||||||
|
`((method_declaration type: [(identifier) (void_keyword)] @font-lock-type-face)))
|
||||||
|
(error
|
||||||
|
`((method_declaration type: [(identifier) (predefined_type)] @font-lock-type-face))))
|
||||||
(method_declaration type: (generic_name (identifier) @font-lock-type-face))
|
(method_declaration type: (generic_name (identifier) @font-lock-type-face))
|
||||||
(method_declaration name: (_) @font-lock-function-name-face)
|
(method_declaration name: (_) @font-lock-function-name-face)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue