Bug 240170 - [xslt][editor] XPath content assist does not narrow results
Summary: [xslt][editor] XPath content assist does not narrow results
Status: RESOLVED FIXED
Alias: None
Product: WTP Source Editing
Classification: WebTools
Component: wst.xpath (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows Vista
: P4 normal (vote)
Target Milestone: 3.1   Edit
Assignee: David Carver CLA
QA Contact: Doug CLA
URL:
Whiteboard:
Keywords: bugday, helpwanted
Depends on:
Blocks:
 
Reported: 2008-07-09 10:33 EDT by Doug CLA
Modified: 2010-08-11 17:08 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 Doug CLA 2008-07-09 10:33:55 EDT
When I type 'tran' into a select attribute, and then hit Ctrl+Space I expect to see all possible completions that begin with 'tran', but what I get instead is the entire list of completions.
Comment 1 David Carver CLA 2008-07-09 11:56:54 EDT
Translate shows up as the first option.  If you continue typing, it will filter out the list.
Comment 2 Doug CLA 2008-07-09 12:31:11 EDT
I was expecting it to work in the same way as the Java completion processor i.e. when I type 'tran' then it only shows me completions starting with 'tran'?
Comment 3 David Carver CLA 2008-07-09 12:47:35 EDT
Yeah I agree it should.  Want to attach a unit test for it?   It's pretty easy to create one for the the XSL Content Assist.  Check out the existing tests in the xsl.ui.tests project.
Comment 4 Doug CLA 2008-07-09 15:25:31 EDT
Ok - I added a test for that - it was piece of cake (though I got confused about which file was being read by the test - the correct utils.xsl was the one in the zip file which is slightly different to the other one).
Comment 5 David Carver CLA 2008-07-09 15:36:22 EDT
(In reply to comment #4)
> Ok - I added a test for that - it was piece of cake (though I got confused
> about which file was being read by the test - the correct utils.xsl was the one
> in the zip file which is slightly different to the other one).
> 

Thanks, I'll see if I can work on it tonight and get the test passing.
Comment 6 David Carver CLA 2008-07-09 21:52:52 EDT
I've looked at this and it has to do with how the matchString is being set, and some of the offsets.   I've run and stepped through a couple of situations, and haven't gotten it to where it needs to be.   I'm going to drop the priority of this as its more of an annoyance than anything else, but I don't think I'm going to get this addressed during the 0.5m9 time frame.

I've changed the target to future. and will add the bugday, and helpwanted keywords to this as well.
Comment 7 David Carver CLA 2008-08-18 11:09:34 EDT
Targeting for 1.0M2
Comment 8 David Carver CLA 2008-09-01 20:02:19 EDT
I've checked in some new code that seems the help with this particular bug.   Also, it should be much easier to add content assistance that is XSL specific.   I've rewritten the XSLContentAssistProcessor so that it doesn't extend the XMLContentAssistProcessor, the XSLContentAssistProcessor will instantiate the XML processor when appropriate to get general XML content assistance.  If assistance is requested for XSL specific functionality then this is handled by the XSL processor itself.

In particular, XSL assistance extends and implements classes based on ContentAssistRequest.   There are classes now for the select and test attributes.   Additional classes will be created for Named Templates and Match Templates, as well as Include and Import to provide content assistance for XSL stylesheets.

This restructuring should make it easier to add XSL functionality while maintaining general XML functionality.

Doug if you can give this a test, I can continue doing some more tweaks.  I'm going to keep this open for a while.  but the code passes all the tests, even the one you had created earlier for 240170.  
Comment 9 David Carver CLA 2008-09-02 22:14:02 EDT
I've fixed the last remaining known issue with this.  The content assistance should now narrow like the JDT content assistance, and all tests are passing.  I added a few additonal tests to catch a few edge cases. As well.
Comment 10 David Carver CLA 2009-04-30 14:28:58 EDT
mass update to 3.1 target due to movement from wtp incubator to wtp source editing lost the original milestones.