Hello Spyder maintainers,
I have been wishing for this feature that can turn sequences or call args, list or tuple items, dictionaries key-value pairs, and multiple assignment to their 'one per line' (transform_to_multiline) or 'all in one line' (transform_to_oneline) versions.
I actually implemented it, and it works neatly !
I might produce a PR (or maybe first a video demo).
For now I have several questions, on a technical aspect :
What will be the easiest way to make a PR ? Is it by forking the repo, then clone on local, then commit changes, push, then submit the PR via github ?? (I am only used to git in a mono-user usage, and not much experienced with branches, but I can follow a procedure.)
A bit more technical :
I guess the main concern about the changes is that I import (lazily) ast into codeeditor.py... Is this acceptable and could ast be imported at top-level ? (only one function uses ast to identify top-level items of sequences/assignments, the function might also belong to another file)
Even more technical (on code architecture) (maybe that question belongs to the PR):
There are several functions within the BaseEditMixin in mixins.py (namely insert_text, replace_text, remove_text), that seem to be made to be used for this kind of feature modifying the editor contents, but that also emit some signals, trying to use them yielded some instability/cursor glitches. I ended up working from the transform_to_uppercase (and lowercase) functions as a basis. I added a replace_selected_text method, should it belong to codeeditor.py or somewhere else ? (Note : transform_to_uppercase (and lowercase) are slightly improved by the changes as the cursor selection zone is now preserved upon transformation of the text)
Hello Spyder maintainers,
I have been wishing for this feature that can turn sequences or call args, list or tuple items, dictionaries key-value pairs, and multiple assignment to their 'one per line' (
transform_to_multiline) or 'all in one line' (transform_to_oneline) versions.I actually implemented it, and it works neatly !
I might produce a PR (or maybe first a video demo).
For now I have several questions, on a technical aspect :
What will be the easiest way to make a PR ? Is it by forking the repo, then clone on local, then commit changes, push, then submit the PR via github ?? (I am only used to git in a mono-user usage, and not much experienced with branches, but I can follow a procedure.)
A bit more technical :
I guess the main concern about the changes is that I import (lazily)
astintocodeeditor.py... Is this acceptable and couldastbe imported at top-level ? (only one function usesastto identify top-level items of sequences/assignments, the function might also belong to another file)Even more technical (on code architecture) (maybe that question belongs to the PR):
There are several functions within the
BaseEditMixininmixins.py(namely insert_text, replace_text, remove_text), that seem to be made to be used for this kind of feature modifying the editor contents, but that also emit some signals, trying to use them yielded some instability/cursor glitches. I ended up working from thetransform_to_uppercase(and lowercase) functions as a basis. I added areplace_selected_textmethod, should it belong tocodeeditor.pyor somewhere else ? (Note :transform_to_uppercase(and lowercase) are slightly improved by the changes as the cursor selection zone is now preserved upon transformation of the text)