ipython-contrib/jupyter_contrib_nbextensions

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

jcb91 commented

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...

jcb91 commented

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"
jcb91 commented

I've made a PR which should fix this - see #820.

Thanks @jcb91 for the Quick fix.

How do I update to include this fix? I installed using conda install -c conda-forge jupyter_nbextensions

jcb91 commented

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:

  1. 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
    
  2. 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 using

    conda build ./conda.recipe
    
  3. 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

jcb91 commented

Glad you found it helpful :)
Merry Yuletide!