HI,
The completion engine does filter on what is being assigned into.
Thus, in the second case, it will only return methods that also return
string.
In the first case, the declaration of 's' is incomplete, so it doesn't
know what the output type is.
Use
M-x semantic-analyze-current-context RET
to see what sorts of things it is tracking, such as what it is assigning
into.
Eric
On Sun, 2009-06-07 at 13:30 +0800, bread wrote:
> Hi,
>
> I've found this several days ago and i wrote a snippet to show it:
>
> #include <iostream>
> #include <vector>
> #include <string>
> using namespace std;
>
> int main() {
> vector<string> v(10, "Hello, Bread");
> string s = v. // 1st completion
> string sBread;
> sBread = v. // 2nd completion
>
> return 0;
> }
>
> Semantic gave different completions candidates while the above 2
> completions are requested.
>
> All methods of class vector can be gotten from the 1st one while only
> several ones gotten from the 2nd one. So, maybe semantic implemented a
> mechanism to give completions according to the type which is assigned
> to ? But "s" and "sBread" are both string and that's why i think there
> might be something wrong here.
>
> Thanks.
>
> --
> Zhiqiu Kong (孔直秋)
>
> EDA Labs
> Dept. Computer Science & Technology
> Tsinghua University
> P.R China
> 100084
> ------------------------------------------------------------------------------
> OpenSolaris 2009.06 is a cutting edge operating system for enterprises
> looking to deploy the next generation of Solaris that includes the latest
> innovations from Sun and the OpenSource community. Download a copy and
> enjoy capabilities such as Networking, Storage and Virtualization.
> Go to: http://p.sf.net/sfu/opensolaris-get
> _______________________________________________ cedet-semantic mailing list cedet-semantic@... https://lists.sourceforge.net/lists/listinfo/cedet-semantic
|