D17971: Revive External Tools plugin

gregormi noreply at phabricator.kde.org
Mon Feb 4 20:55:19 GMT 2019


gregormi added a comment.


  In D17971#404900 <https://phabricator.kde.org/D17971#404900>, @dhaumann wrote:
  
  > @gregormi
  >
  > - Output "Replace Current Document": works fine. Idea: restore cursor position after operation.
  >   - Given the document usually changed afterwards, "restoring the cursor position" is pretty much undefined, and almost never correct...
  
  
  Hmm. My idea came from this siutation: 1) have an XML document open, 2) cursor somewhere near the top, 3) Run Format document. => View is scrolled down to the bottom. More comfortable would feel if the view would stay somewhere around the original position (must not be exact). Especially when formatting almost correctly formatted documents the document does not change that much. In any case: a nice-to-have feature.
  
  > - Make tools available by default: I don't want to clutter the user with hundreds of tools. That's why I proposed the "Template". In general, I am not a big fan of adding everything "just because we can".
  
  I'm looking forward to having 100 tools :-). One thing came to my mind: what if we had **externalstools.default** and **externaltools.extra**? The tools defined in the first file are added by default. The second file contains those tools that must be added via "Templates". Personal note on the name "template": for a ready-made tool that can just be used as it is (which hopefully most of the tools are), the term "template" does not fit so good.
  
  > - Auto quoting: Currently I use `KShell::splitArgs(m_tool->arguments)` to get a list that I can pass to the QProcess. I assumed that this is correct in mooooost of the cases. Do we really want to have manual work here? Where is your bug? ;)
  
  My bug: `cowsay Hello World`
  
  shows
  
     _______________ 
    < 'Hello World' >
     --------------- 
            \   ^__^
             \  (oo)\_______
                (__)\       )\/\
                    ||----w |
                    ||     ||
  
  via the plugin, instead of
  
     _____________ 
    < Hello World >
     ------------- 
            \   ^__^
             \  (oo)\_______
                (__)\       )\/\
                    ||----w |
                    ||     ||
  
  ...let us call it a minor bug ;-) and set it aside for now.
  
  > - ideas for later: git, select a branch: I don't have plans to extend a general purpose tool (external tools) into something that needs a lot of special handling. If you have a general purpose solution, fine, otherwise: wish rejected.
  
  I thought about a general purpose solution: What about adding a new variable **"ExternalTools:ScriptsPath"** which points to a (new) directory "scripts" which is located in parallel to the externaltools file? In this directory scripts can be added that fulfill more special yet useful tasks, like the mentioned git tasks. I can also imagine more complex scripts that extract useful information out of the git repo and show it as HTML file (e.g. author statistics, extended blame or log info etc.) or help to extract a subfolder as a new git repository preserving its history.
  
  By the way: idea for later for another Output type: **"Show as popup"** or "Display as inline note".  This could be used for tools with little output like "Git Blame / Who touched this line last?" which runs only on the currently selected line.
  
  > The following list is my current proposal of variables. These variables already vary from Qt Creator. Not everything else matches anyways:
  >  ...
  >  Any objections or additons to this?
  
  Looks good. Is there a specific reason why the "variables already vary from Qt Creator"? I thought a goal was to make them as similar as possible. Otherwise fine.
  I am curious: Is there a use case for the global cursor coordinates (in pixels, I suppose)?
  For clang-format something like "CurrentDocument:Selection:StartBytes", "CurrentDocument:Selection:EndBytes", and "CurrentDocument:Selection:ByteCount" could be helpful.
  
  > CurrentDocument:Selection:Text      - Current document: Full path excluding file name.
  >  Time:Loca                           - The current time in current locale format.
  
  minor copy&paste errors

REPOSITORY
  R40 Kate

REVISION DETAIL
  https://phabricator.kde.org/D17971

To: dhaumann, cullmann, gregormi
Cc: brauch, pino, ngraham, kwrite-devel, hase, michaelh, demsking, cullmann, sars, dhaumann
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kwrite-devel/attachments/20190204/1609756a/attachment-0001.html>


More information about the KWrite-Devel mailing list