Hinterland: Disable automatic hinting when typing a comment
aswinmohanme opened this issue · 7 comments
So the automatic hinting is awesome , but there is no need for it when we are typing comments , as it is mildly annoying.
So I think autocomplete when commenting should be disabled
Thanks
Yeah, I can see what you mean, definitely.
There's a minor complication in implementation though, as currently we just request hints for every character which matches the hinterland.include_regexp
, and doesn't match the hinterland.exclude_regexp
(tested against the character just inserted before the cursor). I've just realised that I never updated the readme to refer to those regexes, whoops. To not hint in comments, we'd need to know whether we're in a comment or not, which isn't really possible with regular expressions, and would need a fully-fledged parser for the kernel language in use, so it doesn't make sense to implement in hinterland directly. It may be possible to make use of the codemirror parser somehow, but I'll have to do some trawling through the source before I can figure out how to do that...
actually, I think we could do this using a test something along the lines of
cell.code_mirror.getTokenAt(cell.code_mirror.getCursor()).type === "comment"
Thanks @jcb91 for the Quick fix.
How do I update to include this fix? I installed using conda install -c conda-forge jupyter_nbextensions
I installed using
conda install -c conda-forge jupyter_nbextensions_configurator
I guess you meant
conda install -c conda-forge jupyter_contrib_nbextensions
rather than just the jupyter_nbextensions_configurator
?
How do I update to include this fix?
I haven't thrown together a conda-forge release which includes this yet.
You can install the master version from the provided git-based conda.recipe as follows:
-
Clone the git repo into a location of your choosing, and then change into the cloned repo directory:
git clone https://github.com/ipython-contrib/jupyter_contrib_nbextensions.git cd jupyter_contrib_nbextensions
-
Build the local conda recipe, which is found in the conda.recip directory. This may require you to install the
conda-build
package, but you should be prompted if that's the case. Build the recipe usingconda build ./conda.recipe
-
Run conda install with the locally-built recipe from step 3:
conda install --use-local jupyter_contrib_nbextensions
Thanks @jcb91 , this was by far my most awesome experience with an Opensource Project. Keep up the Good Work and Happy Coding.
Tested and Works Like a Charm
P.S : I meant conda install -c conda-forge jupyter_contrib_nbextensions
, my bad.
ohh , Happy Christmas too
Glad you found it helpful :)
Merry Yuletide!