D19795: Add Variable interface to KTextEditor::Editor

Dominik Haumann noreply at phabricator.kde.org
Fri Mar 15 21:00:23 GMT 2019


dhaumann created this revision.
dhaumann added a reviewer: cullmann.
Herald added projects: Kate, Frameworks.
Herald added subscribers: kde-frameworks-devel, kwrite-devel.
dhaumann requested review of this revision.

REVISION SUMMARY
  The Variable interface allows to register either exact matches
  of the form %{Document:Text} or prefix matches of the form
  %{Date:} where the text after the colon (separator) is passed
  to the evaluation of the variable.
  
  This functionality is required for the External Tools plugin,
  that will use this interface to do its macro expansion.
  
  A unit test demonstrates a bit how it works.
  
  Some possible/fictive examples:
  
  - %{CurrentDocument:Text} evaluates to documents contents
  - %{UUID} evaluates to a random uuid
  - %{Time:hh-mm} evaluates to 17-35
  
  Currently, none of these variables are added, it's just the
  interface.

TEST PLAN
  make && make test

REPOSITORY
  R39 KTextEditor

BRANCH
  variable-interface

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

AFFECTED FILES
  autotests/CMakeLists.txt
  autotests/src/variable_test.cpp
  autotests/src/variable_test.h
  src/CMakeLists.txt
  src/include/CMakeLists.txt
  src/include/ktexteditor/editor.h
  src/include/ktexteditor/variable.h
  src/utils/kateglobal.h
  src/utils/katemacroexpander.cpp
  src/utils/katemacroexpander.h
  src/utils/ktexteditor.cpp

To: dhaumann, cullmann
Cc: kwrite-devel, kde-frameworks-devel, gennad, domson, michaelh, ngraham, bruns, demsking, cullmann, sars, dhaumann
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20190315/43903096/attachment.html>


More information about the Kde-frameworks-devel mailing list