Open benogle opened 9 years ago
I'm admittedly not suuuper keen on this.
I like the per-provider idea. I don't even see the need for this to be user-configurable (it could still be of course).
I don't want html to be auto-completed in comments or strings. I don't want python to be auto-completed in comments or strings. I only want file paths to be auto-completed in strings.
Something like that is more of an experience defined by the provider. I don't foresee any need to change this (unless the provider is misbehaving in which case a PR would fix that).
Yes, please at least disable completions in comments. It it annoying when typing plain text.
Although, if it is a documentation-style (i. e. yuidoc) comment, it makes sense to complete some parts of it (keywords usually start with @
or {
).
It's really easy to do this in the providers (as I've done in the autocomplete-plus-python-jedi provider), and the providers probably know a lot better when it's not applicable to provide autocompletion. When writing e.g. text documents (LaTeX, for example?) you probably want autocompletion in your comments?
Yeah, I'm not in for disabling in comments wholesale, but ok with disabling the default provider in comments / strings.
Yeah, I'm not in for disabling in comments wholesale, but ok with disabling the default provider in comments / strings.
:thumbsup:
Text gleaned from comments also pollutes project wide suggestions. Is this intended?
Text gleaned from comments also pollutes project wide suggestions. Is this intended?
Yeah, it's intentional.
Also agree that autocomplete in comments is undesirable. When authoring comments and pressing enter to start a new line, it's confusing when a word gets autocompleted instead, especially when there is a slight delay.
The problem with leaving it up to the provider is when the default provider is completely suitable for your language (i.e. JavaScript).
This is similarly a problem when editing Markdown files. You can completely disable Autocomplete, but then plugins like autocomplete-bibtext don't work. It would be nice to have a per-provider blacklist - e.g. by splitting the default provider into its own package and giving it its own settings.
Just in case anyone wants a quick and dirty solution, you can disable Autocomplete+ in comments by adding a scope blacklist with .comment.block
in the settings of autocomplete+
:+1: for disabling in comments. For what it's worth, I'd be satisfied with having to explicitly invoke autocomplete through a keyboard shortcut if I wanted to use it in a comment.
Thanks @ChrisAlvares. That tip saved me a lot of frustration. I found that blacklisting .comment
entirely was best for me.
thank you @wmadden
For others scratching their heads with .comment.block
and wondering why suggestions still appear, try .comment
-- I suspect this is because in my case most of my comments are regular //
lines that aren't "block" comments. Anyway, just .comment
worked for me.
I think this should be the default setting, frankly. Autocomplete in comments is annoying, not helpful.
Agreed. It's frustrating that this isn't off by default.
Also frustrated by this behavior. Blacklisting .comment
does the trick, but it should be blacklisted by default.
Perhaps using comments as an example under the Scope Blacklist setting would 'solve' this for most users?
Blacklisting .comment
is not working for me in Atom 1.15.0 in Clojure (.clj
) files.
Has something changed that broke this blacklisting?
Replying to myself...
Has something changed that broke this blacklisting?
Yes, it's broken. See #222 - "Scope blacklist doesn't seem to be working for me".
Here's a hint specifically for autcomplete-python users:
I added .string.quoted
to the Scope Blacklist box in the autocomplete-plus settings screen, and autocomplete now ignores strings -- including docstrings.
FWIW: Figuring this out was greatly aided by the article recommended in the Scope Blacklist setting descriptions
Here are my versions:
Atom 1.32.0 Electron 1.0.9 Chrome 61.0.3163.100 Node 8.9.3 autocomplete-plus 2.41.0 autocomplete-python 1.10.12
For others scratching their heads with
.comment.block
and wondering why suggestions still appear, try.comment
-- I suspect this is because in my case most of my comments are regular//
lines that aren't "block" comments. Anyway, just.comment
worked for me.I think this should be the default setting, frankly. Autocomplete in comments is annoying, not helpful.
how do you blacklist something
how do you blacklist something
@javaboi03 Go to Settings > Packages > Autocomplete Plus. Then scroll down to 'Blacklist'
How can we disable suggestions inside comments in my javascript code?
Opening this based on the discussion beginning from https://github.com/atom-community/autocomplete-plus/issues/351#issuecomment-91337251
@maxbrunsfeld says:
We could adjust this selector (or equiv on symbol provider) to not include comments / strings.