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

Hinterland: Disable automatic hinting when typing a comment #819

Closed
aswinmohanme opened this issue Dec 15, 2016 · 7 comments · Fixed by #820
Closed

Hinterland: Disable automatic hinting when typing a comment #819

aswinmohanme opened this issue Dec 15, 2016 · 7 comments · Fixed by #820

Comments

@aswinmohanme
Copy link

aswinmohanme commented Dec 15, 2016

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
Copy link
Member

jcb91 commented Dec 15, 2016

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
Copy link
Member

jcb91 commented Dec 15, 2016

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
Copy link
Member

jcb91 commented Dec 15, 2016

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

@aswinmohanme
Copy link
Author

aswinmohanme commented Dec 16, 2016

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
Copy link
Member

jcb91 commented Dec 16, 2016

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
    

@aswinmohanme
Copy link
Author

aswinmohanme commented Dec 17, 2016

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
Copy link
Member

jcb91 commented Dec 17, 2016

Glad you found it helpful :)
Merry Yuletide!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants