Closed hyperknot closed 9 years ago
Couldn't reproduce it
This tooltip thing goes even crazier from time to time. I made a screen capturing of the behaviour when it was just always displaying docstring tooltips, all the time, without me pressing any buttons, not even saving. Then after removing a character it displayed it again: https://youtu.be/2j5OUGclsTA
Hi. I still can't reproduced that behavior in none of my boxes so it's really hard to fix something that I can't test. I've seen the video and I agree that's pretty annoying.
Which other plugins do you have installed in your Sublime Text along with anaconda?
While we find the possible cause for that behavior in your environment you will want to disable the tooltips setting enable_signatures_tooltip": false
at any of your configuration levels.
these are all my packages, I'll try to debug and see if disabling them helps:
"installed_packages":
[
"Anaconda",
"Compare Side-By-Side",
"CSS Format",
"Expand Tabs on Save",
"HexViewer",
"HTMLBeautify",
"INI",
"JavaScriptNext - ES6 Syntax",
"Jinja2",
"JsFormat",
"JSHint",
"JSONLint",
"LESS",
"Less2Css",
"Neon Color Scheme",
"Package Control",
"Plist Binary",
"Pretty JSON",
"Python Flake8 Lint",
"Python Improved",
"Theme - Soda",
"URLEncode"
]
I found it! It's Expand Tabs on Save
, an other very useful package for Python developers.
The whole package is only 10 lines of Python code, I believe you can even integrate the functionality into Anaconda if you'd like. It'd be a great feature for Anaconda (very useful to convert tabs to spaces in the Python world), and this bug could be taken care of.
https://github.com/bubenkoff/ExpandTabsOnSave-SublimeText/blob/master/ExpandTabsOnSave.py
BTW, the code of that plugin is just super super simple, all it does is it runs view.run_command('expand_tabs')
in an on_pre_save
hook. I think Anaconda should handle this situation easily, there must be other plugins doing something in a on_pre_save hook
.
I guess the expand action fires the on_modified
trigger in Sublime Text 3, not much that can be done in anaconda really.
I guess there must be a workaround, why would an on_modified trigger a docstring window? I believe if you'd integrate this feature into Anaconda itself, you can control exactly when is it called thus avoid the bug. But what with all other plugins which call something similar?
The tooltip is shown after a successful linting of the buffer, the linter is triggered on modifications if you have it configured to run always in the background.
But I explicitly disabled the linting: with "anaconda_linting": false,
Oh, you are right, I forgot that I decoupled that functionality and now is independent from the linting process.
This has been fixed already (at least for this case) and will be available in the next release (probably tomorrow or next Saturday).
Cool, looking forwards to trying it!
Many times (50% of the time, but it happens either always on or always not) anaconda shows a docstring tooltip when I save a file. It only happens if the cursor is over a doctstring-able variable/function.
I don't know what does it depend on, sometimes it happens, sometimes it doesn't.