Hi Christian,
I never got round for thanking you for this, I found it a great time saver , but it was a bit dodgy and now it seems it has gone in the latest 8.4 :-).
It's probably the most flexible solution as long as we don't do real
parsing.
And now you do? What I really want, in the editor, is an module import wizard that allows me to pick from a variety of sources e.g. relative files, the repository
/Andy
On 23 December 2014 at 16:22, Christian Grün christian.gruen@gmail.com wrote:
Hi Andy,
I have added your requested menu item "Add as Import" in BaseX [1]. The feature, as implemented right now, feels a bit dodgy, because it does many things in one place (parsing a file, extracting things, building a string, adding it to the editor), and I haven't checked all possible error cases yet. But after all it cannot cause any real problems.. I decided to add the import statement at the cursor position. It's probably the most flexible solution as long as we don't do real parsing.
Cheers, Christian
[1] https://github.com/BaseXdb/basex/issues/1027
On Thu, Nov 13, 2014 at 12:57 PM, Andy Bunce bunce.andy@gmail.com wrote:
Hi,
I often find myself adding module imports in the GUI and I wonder if the following suggestion might speed up that process.
Add a new menu item to the filelist right click context menu "Add as
import"
when the file selection is a XQuery module.
The action would be to add a line to the current edit window source with
import module namespace {$prefix} = '{$namespace}' at {$path};
Where $prefix and $namespace} are read from the source of the selected
file,
and $path is calculated from the relative path from the edit file source
to
the selected filelist source. The line would be inserted at a suitable
place
in the prologue or at the current location if that is too tricky.
/Andy