Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 57898 - [Search] Selection search does not work under all circumstances
Summary: [Search] Selection search does not work under all circumstances
Status: VERIFIED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-parser (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 2.0   Edit
Assignee: John Camelon CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 51841
Blocks:
  Show dependency tree
 
Reported: 2004-04-08 10:10 EDT by James Ciesielski CLA
Modified: 2004-06-14 12:40 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description James Ciesielski CLA 2004-04-08 10:10:44 EDT
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'.
Comment 1 John Camelon CLA 2004-04-08 10:36:35 EDT
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.  
Comment 2 John Camelon CLA 2004-04-10 00:05:29 EDT
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?
Comment 3 John Camelon CLA 2004-04-10 11:51:03 EDT
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?
Comment 4 James Ciesielski CLA 2004-04-13 12:06:12 EDT
"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" :)
Comment 5 John Camelon CLA 2004-04-14 15:53:32 EDT
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.  
Comment 6 John Camelon CLA 2004-04-26 17:44:31 EDT
Fix has been delivered to HEAD branch. 
Comment 7 Pixy CLA 2004-06-09 13:13:40 EDT
This bug has been verified on Eclipse build 20040603 and CDT build 
200406030301, and it passes.

Pixy.
Comment 8 Kleo Hapitas CLA 2004-06-14 12:40:02 EDT
marking as verified