Add default variables for variables interface
ClosedPublic

Authored by dhaumann on Jun 16 2019, 8:10 PM.

Details

Summary

Add set of default variables that are similar to Qt Creator's variables.
These variables will be used in the external tools plugin as well as internally in KTextEditor e.g. to allow adding a date to backup files.

Test Plan

Added unit test + make && make test

Diff Detail

Repository
R39 KTextEditor
Branch
add-default-variables
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 13170
Build 13188: arc lint + arc unit
dhaumann created this revision.Jun 16 2019, 8:10 PM
Restricted Application added projects: Kate, Frameworks. · View Herald TranscriptJun 16 2019, 8:10 PM
Restricted Application added subscribers: kde-frameworks-devel, kwrite-devel. · View Herald Transcript
dhaumann requested review of this revision.Jun 16 2019, 8:10 PM

Btw, if there is a better place for initialization, I'd happily move the code to some other place.

dhaumann updated this revision to Diff 60384.Jun 22 2019, 5:40 PM
  • Implement JS:<code> variable expansion, e.g. %{JS:3+%{JS:2+1}} --> 6
  • Variable expansion: Add unit tests

I'd like to drop the " Current" prefix in all the variables. It just makes the names longer and I don't see any value for users. Comments?

I'd like to drop the " Current" prefix in all the variables. It just makes the names longer and I don't see any value for users. Comments?

There is no other Document than the current one. I also don't come up with an idea where "Current" prefix makes things clearer. => Removal seems ok to me.

dhaumann updated this revision to Diff 60393.Jun 22 2019, 8:17 PM
  • Drop 'Current' prefix and improve documentation

This should be good enough now, OK to commit?

dhaumann edited the summary of this revision. (Show Details)Jun 22 2019, 8:18 PM
dhaumann edited the test plan for this revision. (Show Details)
cullmann accepted this revision.Jun 24 2019, 7:21 PM
This revision is now accepted and ready to land.Jun 24 2019, 7:21 PM
This revision was automatically updated to reflect the committed changes.
cullmann reopened this revision.Jun 25 2019, 6:42 PM

Actually my fix will only help for Unices, on Windows, this will still fail ;=)
Either we guard that for Windows or we check there more env vars.

This revision is now accepted and ready to land.Jun 25 2019, 6:42 PM
This revision was automatically updated to reflect the committed changes.

Ok, use now some self-defined env var with value set by the test itself, that should help on all operating systems.
We don't need to check if HOME is ok.