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

ATM breaks certain rename functionality in PyCharm 2020.3 #716

Closed
akx opened this issue Dec 7, 2020 · 6 comments
Closed

ATM breaks certain rename functionality in PyCharm 2020.3 #716

akx opened this issue Dec 7, 2020 · 6 comments
Labels
bug Something isn't working

Comments

@akx
Copy link
Contributor

akx commented Dec 7, 2020

Describe the bug

This is a weird one...

When ATM is enabled, using the Ctrl+T, Enter shortcut in the PyCharm 2020.3 IDE to rename an identifier doesn't work correctly anymore. Where you should be able to edit text using multiple carets, only arrows and delete/backspace work anymore, so you can't quite rename identifiers (unless you like very short identifiers). Only clicking in the editor restores normal functionality.

I initially thought this was a JetBrains problem/regression and raised an issue on their tracker: https://youtrack.jetbrains.com/issue/PY-45867

Screenshots / video

I overlaid my keypresses on top of the gif to make things hopefully a little clearer.

Broken (when ATM is active)

rename_fail_keys

Working (ATM not active)

This was tried a couple hours later, hence the code isn't the same.

rename_work_keys

Steps to reproduce the bug

  1. Have ATM running.
  2. Open PyCharm 2020.3 (Professional in my case).
  3. Set up a document where you can attempt to rename an identifier.
  4. Hit Ctrl+T to open the Refactor This popover, then hit enter to use "Rename".
  5. Attempt to modify text. It doesn't work correctly.

Workarounds

  • If I use the context menu -> Refactor -> Rename option, this doesn't occur
  • If I use shift+f6 instead of ctrl+t and enter, this doesn't occur
@akx akx added the bug Something isn't working label Dec 7, 2020
@lwouis
Copy link
Owner

lwouis commented Dec 8, 2020

Hi @akx! It's been a while, thanks for the nice quality ticket!

Which exact version are you using? There have been many issues in the past with the EAP branch: #660 #652 #562

@akx
Copy link
Contributor Author

akx commented Dec 8, 2020

Heya 😄

I've downgraded to PyCharm 2020.2.x for the time being because I need both Alt+Tab and working renames. The version that did exhibit this is PyCharm (build #PY-203.5981.165, 07 Dec 2020 16:09) according to the log. Running MacOS 10.15.6, fwiw.

@lwouis
Copy link
Owner

lwouis commented Dec 9, 2020

If downgrading fixes it for you then it seems to be an issue from JetBrain's side. They currently have, in the EAP, this strangeness that if AltTab subscribes to a specific Accessibility Event, it breaks their behavior:

if app.bundleIdentifier == "edu.stanford.protege" || app.bundleIdentifier?.range(of: "^com\\.jetbrains\\..+?EAP$", options: .regularExpression) != nil {

It should be possible that an app break another app by observing its event. The only thing I could imagine is that they rely on their own accessibility events internally, and AltTab listening to it somehow affects it. It could also be a macOS bug that only surfaces because the IDE is Java + large codebase and brings out exotic scenarios.

@ibrahimabdo
Copy link

I think the above regex is failing because the current version of JetBrains products are not in the early access program anymore, therefore they don't have EAP inside their name and bundle identifier.

@akx
Copy link
Contributor Author

akx commented Dec 9, 2020

@lwouis Yeah, indeed 2020.3 is no longer EAP – what functionality is degraded if we don't subscribe to that event at all for any Jetbrains app?

@lwouis
Copy link
Owner

lwouis commented Dec 10, 2020

I didn't understand what you guys were talking about until I went into the Jetbrain Toolbox app, and observed that indeed they have stopped the EAP program on almost all their apps. Some still have it, but most don't. I wasn't aware they stopped doing EAP.

Fun side-note: my AppCode license I've used for the past year to develop AltTab has expired this month. I asked them for a new one, through their OSS program. I hope they don't shut that one down ;p

@akx here is the ticket that this regex fixed: #652. Notice how similar the issue is.

what functionality is degraded if we don't subscribe to that event at all for any Jetbrains app?

The exception prevents us from shaking standard tabs. Jetbrains products don't use AppKit standard tabs, so I think it would be easy to change the regex to match com.jetbrains. and fix this issue

akx added a commit to akx/alt-tab-macos that referenced this issue Dec 23, 2020
akx added a commit to akx/alt-tab-macos that referenced this issue Dec 23, 2020
Not just EAPs; those EAPs have been promoted into standard apps.

Should fix lwouis#716
lwouis pushed a commit that referenced this issue Jan 5, 2021
Not just EAPs; those EAPs have been promoted into standard apps.

Should fix #716
@lwouis lwouis closed this as completed in 25343ea Jan 25, 2021
lwouis pushed a commit that referenced this issue Jan 25, 2021
# [6.13.0](v6.12.0...v6.13.0) (2021-01-25)

### Bug Fixes

* app would sometimes quit while in the background (closes [#704](#704)) ([d621ce5](d621ce5))
* disable standard tab detection for all JetBrains apps ([25343ea](25343ea)), closes [#716](#716)
* prevent macos 11 from terminating alt-tab randomly ([2447140](2447140))
* restarting the app would sometimes fail to start again ([56d47fc](56d47fc))
* show window controls, even when mouse hover option is disabled ([c256933](c256933))

### Features

* add app category meta-data ([96572a8](96572a8))
* add swedish and czech localizations ([00e95d6](00e95d6))
* add ukrainian localization ([e576ca1](e576ca1))
* display windows partially on screen correctly (closes [#727](#727)) ([2f92936](2f92936))
* show window partially on-screen (closes [#727](#727)) ([b121162](b121162))
* update japanese, turkish, chinese localizations ([7226c25](7226c25))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants