Code completion in XSL editor

Having trouble installing Oxygen? Got a bug to report? Post it all here.
Zearin
Posts: 107
Joined: Mon Jul 30, 2007 11:31 pm
Location: College Park, MD, United States

Code completion in XSL editor

Post by Zearin »

So, I have a number of "Code Templates" in Preferences⇨Editor⇨Templates⇨Code Templates. These templates are for all of my frequently-used namespaces.

In the prefs dialog I set them to "XML editor", because namespaces are portable (one of their chief purposes they were invented, no?), and I often don't know what document I'm going to use them in ahead of time. I just want them there when I need them, regardless of the type of XML I working on at any given moment.

However, unless I'm doing something wrong, it sure looks like Oxygen is treating the XSL editor differently. The code templates work as expected, popping up when I press CTL+Space, in most XML documents. But for some reason when I attempt the same thing in an XSL document, it doesn't work. (And the "Use Content Completion" option in preferences is checked.)

This makes me sad. :(

Since XSL is XML, I figured the "editor" option in the Code Templates dialog was to limit a template to XSL documents, not to fence out templates with "XML" as their editor.

Assuming that is the correct behavior (which still makes me sad :( ), that means I've got the content completion I want in all XML documents, unless I'm working on an XSL document. This may be counter-intuitive, but I might be willing to deal with it if there were a "copy" feature for code templates, so that I wouldn't have to manually enter all that info again with the trivial difference of changing editor from "XML" to "XSL".

Am I missing something? (I really hope so!)

Little help? :?
-- Zearin
Radu
Posts: 9046
Joined: Fri Jul 09, 2004 5:18 pm

Re: Code completion in XSL editor

Post by Radu »

Dear Zearin,

Indeed XSL is XML but we needed a way to differentiate between editors in which code templates will be activated. So "XML Editor" actually means "generic XML editor".
Starting from Oxygen 9.3 (which will be available in a couple of weeks) you will be able to specify that a code template applies to "All Editors" and it will be available in all editors.
For the moment you have to create a new code template with the same name and content and associate it explicitly with "XSL Editor".
I'll also post a feature request to add a "Duplicate" button to the code templates list.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Zearin
Posts: 107
Joined: Mon Jul 30, 2007 11:31 pm
Location: College Park, MD, United States

Re: Code completion in XSL editor

Post by Zearin »

Okay. Thank you for the clarification!

I just got another idea that may be more useful than a "Duplicate" button: rather than selecting the editor from a dropdown list, what about providing a list of checkboxes for each editor? That would save the user from a lot of duplicate-then-edit tedium (as well as solve the original issue above).

Thanks again for your response!
-- Zearin
Radu
Posts: 9046
Joined: Fri Jul 09, 2004 5:18 pm

Re: Code completion in XSL editor

Post by Radu »

Hi Zearin,

This seems like a good idea.
We'll try to implement it in a future version.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply