branch: elpa/d-mode
commit 653661eb4c0641c9599fdde630f855565d1b45cc
Author: Vladimir Panteleev <[email protected]>
Commit: Vladimir Panteleev <[email protected]>

    Fix parsing qualified types
---
 d-mode.el                | 11 +++++++++--
 tests/fonts_types.d      |  2 ++
 tests/fonts_types.d.html |  2 ++
 3 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/d-mode.el b/d-mode.el
index f42fa5b..ec3c5d8 100644
--- a/d-mode.el
+++ b/d-mode.el
@@ -7,7 +7,7 @@
 ;; Maintainer:  Russel Winder <[email protected]>
 ;;              Vladimir Panteleev <[email protected]>
 ;; Created:  March 2007
-;; Version:  201909082055
+;; Version:  201909090915
 ;; Keywords:  D programming language emacs cc-mode
 ;; Package-Requires: ((emacs "25.1"))
 
@@ -1252,12 +1252,19 @@ Key bindings:
 
     (when res
       ;; D: Skip over template parameters, if any
-      (when (looking-at "!")            ; TODO: maybe use 
c-opt-type-concat-key instead
+      (when (looking-at "!")
        (forward-char)
        (c-forward-syntactic-ws)
        (c-forward-sexp)
        (c-forward-syntactic-ws))
 
+      ;; D: Descend into scope names
+      (when (looking-at "[.]")
+       (forward-char)
+       (c-forward-syntactic-ws)
+       (unless (d-forward-type)
+         (setq res nil)))
+
       ;; Step over any type suffix operator.  Do not let the existence
       ;; of these alter the classification of the found type, since
       ;; these operators typically are allowed in normal expressions
diff --git a/tests/fonts_types.d b/tests/fonts_types.d
index d87091e..bd3406b 100644
--- a/tests/fonts_types.d
+++ b/tests/fonts_types.d
@@ -6,3 +6,5 @@ const(Tpl!(int, "", [1, 2, 3])*) var2;
 assert(to!string(d) == to!string(double.max));
 
 private void resetFile(string name, scope const(char)[] stdioOpenmode, bool 
isPopened) @trusted {}
+
+Parameter!("foo()").Foo var;
diff --git a/tests/fonts_types.d.html b/tests/fonts_types.d.html
index 3d04006..837d207 100644
--- a/tests/fonts_types.d.html
+++ b/tests/fonts_types.d.html
@@ -6,3 +6,5 @@
 <span class="keyword">assert</span>(to<span 
class="negation-char">!</span><span class="type">string</span>(d) == to<span 
class="negation-char">!</span><span class="type">string</span>(<span 
class="type">double</span>.max));
 
 <span class="keyword">private</span> <span class="type">void</span> <span 
class="function-name">resetFile</span>(<span class="type">string</span> <span 
class="variable-name">name</span>, <span class="keyword">scope 
const</span>(<span class="type">char</span>)[] <span 
class="variable-name">stdioOpenmode</span>, <span class="type">bool</span> 
<span class="variable-name">isPopened</span>) <span 
class="c-annotation-face">@trusted</span> {}
+
+<span class="type">Parameter</span><span class="negation-char">!</span>(<span 
class="string">&quot;foo()&quot;</span>).<span class="type">Foo</span> <span 
class="variable-name">var</span>;

Reply via email to