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

Mypy Terminal does not update after saving fixes #19

Open
j-walker23 opened this issue Nov 16, 2018 · 12 comments
Open

Mypy Terminal does not update after saving fixes #19

j-walker23 opened this issue Nov 16, 2018 · 12 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@j-walker23
Copy link

I'm not sure if this is a bug or i'm just super slow.

Once the plugin generates all of the typing errors (which is amaizing by the way, thank you!), the mypy terminal errors will never update no matter what i fix/change.

I feel like this has to be me because no one else has raised this in either open or closed issues but i'm hoping it could be a bug on PyCharm 2018.3 RC.

Is anyone using the latest EAP/RC?

Just to make sure. Are the errors in the terminal suppose to update when i save file changes?

Thanks for any help.

@ilevkivskyi
Copy link
Contributor

This is actually intentional. Currently mypy daemon can be still slow to respond on large code bases (sometimes as slow as 10s) which would make updating on every edit painful. You can still re-run type check manually by hitting Ctrl + Shift + M or pressing the "Run" button.

There is ongoing work to make daemon much faster, after we will add an option to auto-update type checking results.

@ilevkivskyi ilevkivskyi added the enhancement New feature or request label Nov 16, 2018
@j-walker23
Copy link
Author

ahhh! Now it all makes sense. When i first set it up everytime i hit "Run" after the first time it would say it's already running and then crash.
So that made me think the Run button was a one time thing.
I think it had to do with a config i added because now it's working perfectly when i have it re-check the types.

Thanks for your help!

@aolieman
Copy link

In PyCharm 2019.1 I don't seem to be able to re-run the daemon through this plugin. Running it the first time with Ctrl + Shift + M works just fine, but this shortcut has no effect after that.

Should there be a dedicated run button for the mypy terminal? If so, it doesn't display for me. The ordinary run button (with project configurations) runs whatever commands or files have been configured, but this also seems to have no effect on the mypy terminal.

@ilevkivskyi
Copy link
Contributor

Should there be a dedicated run button for the mypy terminal?

Yes, there should be a button. Could you please attach a screenshot?

@aolieman
Copy link

aolieman commented May 22, 2019

Okay, there is a run button in the bottom-right corner of the mypy terminal that I didn't see before. It might have been hidden behind a pycharm notification.

And indeed, the mypy run button works as expected, allowing to re-run. It's just the keyboard shortcut that only works once, until pycharm is fully restarted.

@ilevkivskyi
Copy link
Contributor

@aolieman
Could you please provide a bit more details about your system and PyCharm minor version? I just tried this on Mac in PyCharm 2019.1.2 and everything worked correctly.

@aolieman
Copy link

aolieman commented Jun 4, 2019

Of course: I'm running PyCharm 2019.1.3 on Ubuntu 18.04. PyCharm is installed with snap, and recently updated to the latest minor version. The keyboard shortcut Ctrl + Shift + M didn't work for me in earlier minor versions either. This may be mostly irrelevant, since I just figured out that the issue is caused by PyCharm's keymap settings.

When trying the shortcut again just now, I noticed that this key combo is mapped to something in PyCharm: when the cursor is placed between any kind of brackets in the editor pane, the shortcut toggles the cursor position between the opening and closing bracket. This is listed as "Move Caret to Matching Brace" in the default keymap, and many others (I didn't check them all).

So this is just another hotkey clash, and going by #1 you were already aware of this particular one. I wasn't too bothered by the issue after finding the run button, but it's nice to be able to rerun without having to click since I edited the keymap.

Perhaps you were thrown off by my initial report, that:

Running it the first time with Ctrl + Shift + M works just fine, but this shortcut has no effect after that.

That wasn't entirely accurate. It has to do with pane focus within PyCharm: the hotkey works just fine on a fresh startup, and also when focus is on the project/files pane, regardless of the keymap. The counter-intuitive thing is that I tried to put focus on the Mypy terminal before, but that doesn't take focus away from the editor pane.

@ilevkivskyi
Copy link
Contributor

@aolieman Thanks for investigation! I will raise priority for #1.

@devxpy
Copy link

devxpy commented Oct 7, 2019

Currently mypy daemon can be still slow to respond on large code bases

Does mypy still suffer from this limitation after the introduction of mypyc?

@ilevkivskyi
Copy link
Contributor

Does mypy still suffer from this limitation after the introduction of mypyc?

It is 5x faster, but still I don't want this to be the default (partially because it is conceptually wrong, mypy is not a linter, partially because we need to figure out what to do if there is a syntax error in the code, which is almost always the case while one types).

@syastrov
Copy link

PyCharm can usually already detect syntax errors by itse;f. Maybe the plugin could somehow detect (via PyCharm) that there are no syntax errors and only then run mypy?
Or, run mypy and if there are syntax errors, just don't show any output?

@ilevkivskyi
Copy link
Contributor

Maybe the plugin could somehow detect (via PyCharm) that there are no syntax errors and only then run mypy?

Yeah, this was the plan, I just didn't have time to figure out how this would work. If you have time, PRs are very welcome!

@ilevkivskyi ilevkivskyi added the help wanted Extra attention is needed label Nov 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

5 participants