Bug 217821 - [content assist] Code assist BETWEEN 2 different Style rules does not work
Summary: [content assist] Code assist BETWEEN 2 different Style rules does not work
Status: RESOLVED WONTFIX
Alias: None
Product: WTP Source Editing
Classification: WebTools
Component: wst.css (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.4.2   Edit
Assignee: Nick Sandonato CLA
QA Contact: Nick Sandonato CLA
URL:
Whiteboard:
Keywords: helpwanted
Depends on:
Blocks:
 
Reported: 2008-02-05 07:43 EST by Yaron Mazor CLA
Modified: 2012-10-11 11:13 EDT (History)
3 users (show)

See Also:


Attachments
Fix Patch (31.38 KB, patch)
2009-08-10 13:11 EDT, Aidyl Kareh CLA
no flags Details | Diff
JUnit Patch (4.82 KB, patch)
2009-08-10 13:15 EDT, Aidyl Kareh CLA
no flags Details | Diff
JUnit Patch Updated (6.96 KB, patch)
2009-08-11 10:23 EDT, Aidyl Kareh CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yaron Mazor CLA 2008-02-05 07:43:47 EST
1. I have the following CSS file :
--------------------------------   
1  H1 {
2	
3  }
4
5  |
6
7  H2 {
8	
9  }

The caret is positioned in line 5 where the | symbol.


2. Now I write a new selector H3 in line 5 (see caret's new location):
---------------------------------------------------------------------
1  H1 {
2	
3  }
4
5  H3|
6
7  H2 {
8	
9  }

3. Press CTRL+SPACE and choose H3 from the proposals list

No completion of brackets is added.
Comment 1 Aidyl Kareh CLA 2009-08-10 13:11:41 EDT
Created attachment 143926 [details]
Fix Patch

Fixed code so that when a new selector in between Style rules is added using content assist, the proposal selected completes with brackets. Previously the new selector was being read as if it were part of multiple selectors for the same declaration. Now it checks if there is a separator (',' character) between the two selectors, and if there isn't it adds the brackets.
Comment 2 Aidyl Kareh CLA 2009-08-10 13:15:54 EDT
Created attachment 143927 [details]
JUnit Patch

This patch adds a JUnit which uses content assist to add a selector between to two Style rules and makes sure the output is as expected.
Comment 3 Aidyl Kareh CLA 2009-08-11 10:23:09 EDT
Created attachment 144048 [details]
JUnit Patch Updated

Updated JUnit
Comment 4 Nick Sandonato CLA 2012-10-11 11:12:37 EDT
This appears to be working as design since adding a tag at the cursor location could very well be an ancestor in a descendant selector. To create a stand-alone rule after this, typing { will automatically insert the matching }.