D12587: Indentation script for R

2018-09-02 Thread Pierre de Villemereuil
devillemereuil added a comment. Will do. Thanks! REPOSITORY R39 KTextEditor REVISION DETAIL https://phabricator.kde.org/D12587 To: devillemereuil, #ktexteditor, #rkward, cullmann Cc: kwrite-devel, kde-frameworks-devel, cullmann, tfry, dhaumann, michaelh, kevinapavew, ngraham, bruns,

D12587: Indentation script for R

2018-09-02 Thread Christoph Cullmann
cullmann added a comment. I normally follow the steps on https://community.kde.org/Guidelines_and_HOWTOs/Build_from_source and just do kdesrc-build ktexteditor after the initial setup. REPOSITORY R39 KTextEditor REVISION DETAIL https://phabricator.kde.org/D12587 To:

D12587: Indentation script for R

2018-09-02 Thread Pierre de Villemereuil
devillemereuil added a comment. I... git cloned ktexteditor and ran `cmake .`? Is there a better way? Sorry, I'm a real newb in this as you can probably tell! I'm not a dev by training. REPOSITORY R39 KTextEditor REVISION DETAIL https://phabricator.kde.org/D12587 To: devillemereuil,

D12587: Indentation script for R

2018-09-02 Thread Christoph Cullmann
cullmann added a comment. And btw., thanks that you work on that stuff! REPOSITORY R39 KTextEditor REVISION DETAIL https://phabricator.kde.org/D12587 To: devillemereuil, #ktexteditor, #rkward, cullmann Cc: kwrite-devel, kde-frameworks-devel, cullmann, tfry, dhaumann, michaelh,

D12587: Indentation script for R

2018-09-02 Thread Christoph Cullmann
cullmann added a comment. Hi, the message means you need to update the extra-cmake-modules. How did you compile the stuff? If you use kdesrc-build, I would just let that run once more. REPOSITORY R39 KTextEditor REVISION DETAIL https://phabricator.kde.org/D12587 To: devillemereuil,

D12587: Indentation script for R

2018-09-02 Thread Pierre de Villemereuil
devillemereuil added a comment. OK. So, that'll require compile ktexteditor from source. I should be able to manage that (I guess?). I'll report here if it gives me too many headaches. I tried today, but gave up because of an issue with ECM (?) version. I got: Could not find a

D12587: Indentation script for R

2018-09-02 Thread Christoph Cullmann
cullmann added a comment. You might need a .kateconfig in the R folder like in e.g. the cstyle folder which tells "use R highlighting and R indenter" REPOSITORY R39 KTextEditor REVISION DETAIL https://phabricator.kde.org/D12587 To: devillemereuil, #ktexteditor, #rkward, cullmann Cc:

D12587: Indentation script for R

2018-09-02 Thread Christoph Cullmann
cullmann added a comment. I added these lines https://commits.kde.org/ktexteditor/784302a921b8e1fafd6d32cf172552eaea1775bf If you do make, you can later in the build folder run: ./bin/kateindenttest ATM it will tell at the end: SKIP : IndentTest::testR()

D12587: Indentation script for R

2018-09-02 Thread Christoph Cullmann
cullmann added a comment. Ok, here the basic idea: in autotests/src/identtest.cpp and .h > in .h === add some void testR_data(); void testR(); > in .cpp = add some void IndentTest::testR_data() { getTestData("R"); }

D12587: Indentation script for R

2018-09-02 Thread Pierre de Villemereuil
devillemereuil added a comment. That's the thing: I don't know how to run the test. If it requires dealing with cmake and stuff, that's take me a while to figure out. Is there any simple documentation about it? REPOSITORY R39 KTextEditor REVISION DETAIL

D12587: Indentation script for R

2018-09-02 Thread Christoph Cullmann
cullmann added a comment. You don't need to commit them. You just can add them locally test by test and after each one run the indent test locally. REPOSITORY R39 KTextEditor REVISION DETAIL https://phabricator.kde.org/D12587 To: devillemereuil, #ktexteditor, #rkward, cullmann Cc:

D12587: Indentation script for R

2018-09-02 Thread Pierre de Villemereuil
devillemereuil added a comment. So, basically, I just write a bunch of tests, commit them here and we'll debug them if needed from here? REPOSITORY R39 KTextEditor REVISION DETAIL https://phabricator.kde.org/D12587 To: devillemereuil, #ktexteditor, #rkward, cullmann Cc: kwrite-devel,

D12587: Indentation script for R

2018-09-02 Thread Christoph Cullmann
cullmann added a comment. The easiest way is just to put the test in the autotests input like for other highlighters and then run the indent test, that will pick this up and tell you what happens. REPOSITORY R39 KTextEditor REVISION DETAIL https://phabricator.kde.org/D12587 To:

D12587: Indentation script for R

2018-09-02 Thread Pierre de Villemereuil
devillemereuil added a comment. Say that I have the files for a unit test (origin, input.js and expected). How can I check the code for the unit test? Is there a way to simply execute the javascript code and verify it does what I expect? It would be a shame to have the unit test fail

D12587: Indentation script for R

2018-08-15 Thread Pierre de Villemereuil
devillemereuil added a comment. I might get to that around September (no promise). If people are willing to help, my not-unit-at-all test code for indentation can be found here: https://github.com/devillemereuil/rindent/blob/master/example.R Automatic indent should not impact the code

D12587: Indentation script for R

2018-08-15 Thread Dominik Haumann
dhaumann added a comment. @devillemereuil That is good to hear. If you can, feel free to paste a MIT-licensed snippet of R-code with a function, a loop, a if-condition etc. Maybe we find the time to turn this into a unit test. The code does not need to run, it just needs to be syntactically

D12587: Indentation script for R

2018-08-15 Thread Pierre de Villemereuil
devillemereuil added a comment. Just to say: this didn't fall off my radar. I'm just incredibly busy nowadays and it never quite make it to the top of my todo list... But I think about doing it regularly, which is a good sign it'll happen! REPOSITORY R39 KTextEditor REVISION DETAIL

D12587: Indentation script for R

2018-08-14 Thread Christoph Cullmann
This revision was automatically updated to reflect the committed changes. Closed by commit R39:467cf37fd04f: Indentation script for R (authored by cullmann). REPOSITORY R39 KTextEditor CHANGES SINCE LAST UPDATE https://phabricator.kde.org/D12587?vs=33259=39754 REVISION DETAIL

D12587: Indentation script for R

2018-08-14 Thread Christoph Cullmann
cullmann accepted this revision. This revision is now accepted and ready to land. REPOSITORY R39 KTextEditor REVISION DETAIL https://phabricator.kde.org/D12587 To: devillemereuil, #ktexteditor, #rkward, cullmann Cc: kwrite-devel, kde-frameworks-devel, cullmann, tfry, dhaumann, michaelh,

D12587: Indentation script for R

2018-08-14 Thread Christoph Cullmann
cullmann added a comment. Herald edited subscribers, added: kde-frameworks-devel, kwrite-devel; removed: Frameworks. Given it seems nobody has time to do tests, I will merge this. We can still remove it again but just letting rot this nice contribution in the phabricator won't help any R

D12587: Indentation script for R

2018-04-30 Thread Thomas Friedrichsmeier
tfry added a comment. @devillemereuil This was meant to replace calcMismatchIndent(), or at least the upper part of it. But don't let me distract you, here, this is non-essential. Just focus on the unit tests for now. REPOSITORY R39 KTextEditor REVISION DETAIL

D12587: Indentation script for R

2018-04-30 Thread Pierre de Villemereuil
devillemereuil added a comment. I will have a go at it. It doesn't seem very complicated indeed, but I just don't have much time right now for this. @tfry I'm not sure what your pseudo-code is intended to replace? The parts using countClosing? FYI, these snippets of code were copied

D12587: Indentation script for R

2018-04-29 Thread Dominik Haumann
dhaumann added a comment. @devillemereuil If I remember correctly, you do not have to run all tests. It is enough to start the indenter test (look into the bin folder) and add as parameter you indent test folder (relative, e.g. cstyle). And, what Thomas says is correct. Typically a test

D12587: Indentation script for R

2018-04-29 Thread Thomas Friedrichsmeier
tfry added a comment. Regarding the unit tests: Take a look at e.g. https://cgit.kde.org/ktexteditor.git/tree/autotests/input/indent/cmake/enter1 . You start with an initial text "origin", then emulate some input "input.js", an specify the expected state at the end "expected". Again, I

D12587: Indentation script for R

2018-04-29 Thread Pierre de Villemereuil
devillemereuil added a comment. In D12587#255484 , @dhaumann wrote: > I think this is very cool. But there is one thing we require for new indenters: unit tests. > > There is a subfolder autotest in the KTextEditor git module. Could you have

D12587: Indentation script for R

2018-04-29 Thread Dominik Haumann
dhaumann added a comment. I think this is very cool. But there is one thing we require for new indenters: unit tests. There is a subfolder autotest in the KTextEditor git module. Could you have a look into this? Without such automated tests, we will likely introduce regressions in

D12587: Indentation script for R

2018-04-28 Thread Pierre de Villemereuil
devillemereuil created this revision. devillemereuil added reviewers: KTextEditor, RKWard. Restricted Application added projects: Kate, Frameworks. Restricted Application added a subscriber: Frameworks. devillemereuil requested review of this revision. REVISION SUMMARY This is a javascript