Community
Participate
Working Groups
Build ID: M20070921-1145 Steps To Reproduce: EXECUTE: Create test.html: <html dir= lang="" > </html> EXCUTE: Ctrl+Space at <html dir= | EXCUTE: Choose "ltr". Enter. FAILURE: We got <html dir= "ltr""" > More information:
Not sure there's much that can be done here. The presence of the first '=' combined with lack of an attribute value makes the "lang" attribute name be interpreted as the value of the "dir" attribute.
I think a solution can be found here because invoking content assist at <html dir=| lang="" > results in: <html dir="ltr" lang="" > while <html dir= | lang="" > results in <html dir= "ltr""" > Thus whatever is being done for the first case should be done for the second case, most likely having to do with some trickery of the location of the cursor and the = that could be expanded to include whites pace after the =.
Created attachment 216991 [details] Initial patch
Attaching an initial proposed patch. It consist in skiping the replacement of the region, when the offset is not at the beginning of the region, only when the region is XML_TAG_ATTRIBUTE_EQUALS. Example: <html dir= | lang="" > result: <html dir= "ltr" lang="" > I already run the following junits with successful results: org.eclipse.wst.xml.ui.tests org.eclipse.wst.html.ui.tests org.eclipse.wst.css.ui.tests
Hi, Chava. Thanks for taking a look at this. Another scenario that I just tried was <html dir= |lang="en"> and this caused the lang= to be consumed similar to the other scenario. Would it be possible to correct that as well?
Hello Nick: On that particular scenario the completionRegion is recognized as XML_TAG_ATTRIBUTE_VALUE, that is why in AbstractXMLCompletionProposalComputer.computeAttributeValueProposals, the setup is to replace the existing value ( in this case lang=). As Nitin says in comment #2, so far i think there is no much we can do.
Understood and I agree. Thanks, Chava.
Changes pushed.
.