branch: externals/csharp-mode commit ca394f1ae70e489f2e9a428169524153315af90b Author: Jostein Kjønigsen <jost...@kjonigsen.net> Commit: Jostein Kjønigsen <jost...@kjonigsen.net>
imenu: Fix indexing of methods in test-file. --- csharp-mode.el | 16 +++++++++++++++- test-files/imenu-method-test.cs | 4 ++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/csharp-mode.el b/csharp-mode.el index 6e620e5..3829cd5 100644 --- a/csharp-mode.el +++ b/csharp-mode.el @@ -1754,7 +1754,7 @@ to the beginning of the prior namespace. (space (concat single-space "+")) (access-modifier (regexp-opt '( "public" "private" "protected" "internal" "static" "sealed" "partial" "override" "virtual" - "abstract"))) + "abstract" "async" "new" "unsafe"))) ;; this will allow syntactically invalid combinations of modifiers ;; but that's a compiler problem, not a imenu-problem (access-modifier-list (concat "\\(?:" access-modifier space "\\)")) @@ -1841,6 +1841,19 @@ to the beginning of the prior namespace. "\\(?:[ \t]*/[/*].*\\)?" optional-space "{") 1) + (list "method-abs-ext" + (concat bol + access-modifier-list "+" + (regexp-opt '("extern" "abstract")) space + return-type space + "\\(" + generic-identifier + optional-space + parameter-list + "\\)" + optional-space + ;; abstract/extern methods are terminated with ; + ";") 1) (list "prop" (concat bol ;; must require access modifiers, or else we @@ -2038,6 +2051,7 @@ to the beginning of the prior namespace. (dolist (type '(("ctor") ("method") ("method-inf" "method") + ("method-abs-ext" "method") ("prop") ("prop-inf" "prop") ("field") diff --git a/test-files/imenu-method-test.cs b/test-files/imenu-method-test.cs index 77b2f9e..0b3b24b 100644 --- a/test-files/imenu-method-test.cs +++ b/test-files/imenu-method-test.cs @@ -24,9 +24,9 @@ public class MethodTest } - public abstract string SubClassMethod(); + public abstract string AbstractMethod(); - public unsafe static void FastCopy(byte[] src, byte[] dst, int count) + public unsafe static void UnsafeCopy(byte[] src, byte[] dst, int count) { }