Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PR: Fix class/function selector for split editors (Editor) #20961

Merged
merged 3 commits into from
Jun 22, 2023

Conversation

rear1019
Copy link
Contributor

Description of Changes

  • Wrote at least one-line docstrings (for any new functions)
  • Added unit test(s) covering the changes (if testable)

This PR fixes missing updates of the class and function selector of vertically/horizontally split (cloned) editors. See commit message for details.

Note: Update of indent guides and code folding in cloned editors is broken as well (similar root cause). I have looked into fixing that as well, however, have not succeeded so far.

Affirmation

By submitting this Pull Request or typing my (user)name below,
I affirm the Developer Certificate of Origin
with respect to all commits and content included in this PR,
and understand I am releasing the same under Spyder's MIT (Expat) license.

I certify the above statement is true and correct:

rear1019

@dalthviz dalthviz added this to the v5.4.4 milestone May 28, 2023
@dalthviz dalthviz changed the title PR: editor: Fix class/function selector for split editors PR: Fix class/function selector for split editors (Editor) May 28, 2023
@dalthviz dalthviz requested a review from ccordoba12 May 28, 2023 21:59
Copy link
Member

@dalthviz dalthviz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @rear1019 ! LGTM 👍

Copy link
Member

@ccordoba12 ccordoba12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @rear1019 for your help with this!

spyder/app/tests/test_mainwindow.py Show resolved Hide resolved
spyder/app/tests/test_mainwindow.py Outdated Show resolved Hide resolved
spyder/app/tests/test_mainwindow.py Outdated Show resolved Hide resolved
spyder/app/tests/test_mainwindow.py Outdated Show resolved Hide resolved
spyder/plugins/editor/widgets/codeeditor.py Outdated Show resolved Hide resolved
spyder/plugins/editor/widgets/codeeditor.py Outdated Show resolved Hide resolved
spyder/app/tests/conftest.py Outdated Show resolved Hide resolved
spyder/plugins/editor/widgets/codeeditor.py Outdated Show resolved Hide resolved
spyder/plugins/editor/widgets/editor.py Outdated Show resolved Hide resolved
@rear1019
Copy link
Contributor Author

Hi @ccordoba12, sorry for the slow response. Unfortunately, I haven’t been able to work on Spyder over the last few weeks. I will try to update this PR the next few days.

Note: Update of indent guides and code folding in cloned editors is broken as well (similar root cause). I have looked into fixing that as well, however, have not succeeded so far.

I managed to come up with a fix if I remember correctly. I will try to make a (draft) PR the next few days.

@rear1019
Copy link
Contributor Author

@ccordoba12 I have added the suggested changes. Concerning broken indention guides and code folding in cloned editors, see #21033.

Copy link
Member

@ccordoba12 ccordoba12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One last minor comment for you @rear1019, the rest looks good to me.

spyder/plugins/editor/widgets/codeeditor.py Outdated Show resolved Hide resolved
@ccordoba12
Copy link
Member

Concerning broken indention guides and code folding in cloned editors, see #21033

Great! Thanks for addressing that problem too.

@ccordoba12
Copy link
Member

@rear1019, please rebase on top of 5.x to get the fix to our tests in PR #21042.

rear1019 and others added 3 commits June 21, 2023 09:09
The test fails as of this commit due to a bug which is fixed in the next
commit
Split editors are “clones” of the “main editor”. Handling of some LSP
related events (e.g. folding and symbols) is performed by the main
editor only (see e.g. CodeEditor.start_completion_services() and
EditorStack.create_new_editor()).

Add missing update of the class and function selector [1] for split
editors.

(Also see PR [2] which fixed a related issue in the Outline plugin.)

[1] See menu entry “Source → Show selection for classes and function”;
    the selector is shown at the top of the editor’s viewport, just
    below the tabbar.

[2] spyder-ide#20221
Co-authored-by: Carlos Cordoba <ccordoba12@gmail.com>
Copy link
Member

@ccordoba12 ccordoba12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me now, thanks @rear1019!

@ccordoba12 ccordoba12 merged commit c6ef456 into spyder-ide:5.x Jun 22, 2023
24 checks passed
ccordoba12 added a commit that referenced this pull request Jun 22, 2023
@rear1019 rear1019 deleted the fix_classfuncdropdown branch January 16, 2024 16:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants