Re: Namespaces in C++
Eric Ludlam <[email protected]> Fri, 20 Nov 2015 21:18:07 -0500
| Newsgroups | gmane.emacs.cedet |
|---|---|
| Message-ID | <[email protected]> |
This is a multi-part message in MIME format.
--------------020706010601050401000009
Content-Type: text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding: 7bit
On 11/04/2015 04:37 PM, Mayuresh Kulkarni wrote:
> Does current CEDET understand namespaces in C++? I tried with the emacs
> 24.5.1 bundled version and also from the git version but it seems not.
>
>
> If I stick the following in a .cpp file
>
>
> namespace Foo {
> void externalFunction();
> }
>
> void myFunction()
> {
> Foo::externalFunction(); <----------
> }
>
> and hover over the indicated line, it shows the signature as void
> externalFunction() (and also nicely highlights the declaration etc) but
> leaves out the namespace qualification.
>
> Just asking if this is a problem with my setup or if this is not
> expected to work.
Yes, it understands namespaces. In the above example, the system finds
"Foo::externalFunction", finds Foo, then finds the correct tag. When
summarizing it doesn't show the extra data.
I looked at idle summary mode, and see it doesn't pass the 'parent' into
the format function. That means it won't prefix with "foo::".
I looked into the format functions, and they tend not to put in the full
name anyway, so fixing that didn't help for most, and I had to be precise.
Anyway the attached patch I don't really recommend, but it does show it
is possible to make it display the namespaces.
I'd like to hear from folks if this ability should be pushed further
through the format functions, and added to idle-summary mode, or if the
current short version is better.
Thanks
Eric
--------------020706010601050401000009
Content-Type: text/x-patch;
name="idle.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="idle.patch"
diff --git a/lisp/cedet/semantic/idle.el b/lisp/cedet/semantic/idle.el
index 6d9e15b..062109a 100644
--- a/lisp/cedet/semantic/idle.el
+++ b/lisp/cedet/semantic/idle.el
@@ -641,7 +641,7 @@ This can prevent minibuffer resizing in idle time."
:type 'boolean)
(defcustom semantic-idle-summary-function
- 'semantic-format-tag-summarize-with-file
+ 'semantic-format-tag-abbreviate
"Function to call when displaying tag information during idle time.
This function should take a single argument, a Semantic tag, and
return a string to display.
@@ -756,7 +756,12 @@ current tag to display information."
(str (cond ((stringp found) found)
((semantic-tag-p found)
(funcall semantic-idle-summary-function
- found nil t)))))
+ found
+ (save-excursion
+ (save-current-buffer
+ (semantic-go-to-tag found)
+ (semantic-current-tag-parent)))
+ t)))))
;; Show the message with eldoc functions
(unless (and str (boundp 'eldoc-echo-area-use-multiline-p)
eldoc-echo-area-use-multiline-p)
--------------020706010601050401000009
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
------------------------------------------------------------------------------
--------------020706010601050401000009
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
Cedet-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cedet-devel
--------------020706010601050401000009--