Community
Participate
Working Groups
Eclipse M8 CDT 2.0.0.200404071510 Test Case: 1. Create a managed project, call it MgdCpp. 2. Add a file to MgdCpp, call it main.cpp. 3. Insert the following code into main.cpp: class Gonzo { public: void playHorn(); // ** (A) ** }; void Gonzo::playHorn() { // ** (B) ** return; } int main(int argc, char **argv) { Gonzo gonzo; gonzo.playHorn(); // ** (C) ** } 4. Attempt selection-search on lines (A), (B), (C) for the token 'playHorn'. (Selection Search->References->Workspace) RESULT: Selection-search on line (A) returns the correct result. Selection-search on lines (B) and (C) yield the message: "The operation is unavailable on the current selection". EXPECTED: I expected selection search to work on all three lines (and yield the same results) as each token represents the same method: 'playHorn'.
Assigning to Bogdan. Selection Search needs to provide the full qualified name to the parser. The SelectionParser does not know that its looking for a method or a class in advance. This may require UI updates so that double-clicking in the editor will automagically select the right amount of text using some simple pattern matching for qualified names.
Actually, thinking about it so more I think I can handle this in the Selection Parser. There may still be a UI issue regarding providing a more C++-esque selection, but we'll handle those cases as they come up. James, do we have a test plan for SS, just so I can structure my junit tests accordingly?
Partial fix committed to HEAD. Case B) now works. Case C is dependent upon other fixes required to the Contextual Parser to get specific context back to the user, as per Content Assit defect 51841. James, in qualified name A::B::C::D, would you expect the user to get a valid search context if they only selected "B::C"? My current behaviour only interprets a greater qualified name if what is selected is a suffix of a greater name : is this correct?
"in qualified name A::B::C::D, would you expect the user to get a valid search context if they only selected "B::C"?" I certainly wouldn't expect it, but I would be impressed if it worked! ;) That is not the type of search I would execute too often (if at all). I would always execute a search based on a single, non-qualified token. ----- "My current behaviour only interprets a greater qualified name if what is selected is a suffix of a greater name : is this correct?" Can you please provide an example of this? I don't understand what you mean by a "greater qualified name" :)
In A::B::C::D::E, any sub-name including ::E would be found, since I can recognize it as being a suffix of A::B::C::D::E. That is what I meant.
Fix has been delivered to HEAD branch.
This bug has been verified on Eclipse build 20040603 and CDT build 200406030301, and it passes. Pixy.
marking as verified