Community
Participate
Working Groups
Using Eclipse 3.5M2. Code assist does not work for the <component> element. Steps... 1. Create a component.xml file and open it in the Service Component editor. 2. Remove everything from the file, apart from the following line: <?xml version="1.0" encoding="UTF-8"?> 3. Now try and use code assist to add the <component> element, but you cannot. The work around here is to close and reopen the file since the Service Component editor is "smart enough" to automatically add the missing <component> element, but even that is questionable behavior, but that's a whole other bug report. :-)
man, this is what we get for trying to include source editing in the first pass of the editor ;)
Want to take a look at this Rafael?
actually Simon, it's a problem if we are missing the component header as we lose the ability to associate the editor with it... since we do it by content type and using the <component> header ;) but I still agree that as long as we are in the ds editor context, we should offer that completion.
Created attachment 113209 [details] DSContentAssistProcessor updates That's what I thought: If the user tries to use the code completion where the range is null, we suggest him to create a component element. Know Issues: If you already have a component element, and calls the code completion outside its range, you can create two component elements in the same file. Is that a big problem?
Supporting multiple <component> elements is actually a requirement! But, to be XML compliant, the document must always have a single root element. Of course, in this case the single root element is not part of the scr namespace, which opens up all sorts of other issues not yet addressed by PDE. For now I'm going refer you to the OSGi spec and this bug in the OSGi bugzilla that talks about this a little: https://www.osgi.org/members/bugzilla/show_bug.cgi?id=590
Thanks Simon. :) And what should we do? Let the code assistant creating multiple <component> elements without handling it?
Chris?
done. Thanks Rafael! > 20090930
The code assist for "component" should not be suggested while inside a <component> element, or any other DS element. This is likely to be tricky because technically speaking, putting a <component> element inside any XML is legal. Leaving RESOLVED for now. Purely FYI.