Dot suggests autocomplete to self
ShadowLNC opened this issue · comments
Prerequisites
- Reproduced the problem in Safe Mode: http://flight-manual.atom.io/hacking-atom/sections/debugging/#using-safe-mode
- Followed all applicable steps in the debugging guide: http://flight-manual.atom.io/hacking-atom/sections/debugging/
- Checked the FAQs on the message board for common solutions: https://discuss.atom.io/c/faq
- Checked that your issue isn't already filed: https://github.com/issues?utf8=✓&q=is%3Aissue+user%3Aatom
- Checked that there is not already an Atom package that provides the described functionality: https://atom.io/packages
Description
Atom suggests an autocomplete of "self" when I type a dot/period/full stop (".").
I would like to disable this autocomplete suggestion. PEP8 specifies comments should be grammatically valid, so when I end with a full stop, it suggests this, and when I press enter to go to a new line, it instead prepends "self" to the full stop.
Steps to Reproduce
- Open a Python file.
- Type some text, e.g. "a".
- Type a dot.
Expected behavior: No autocomplete suggestions.
Actual behavior: Autocomplete suggests "self", even in a comment.
Reproduces how often: 100%
Versions
atom --version
Atom : 1.28.0
Electron: 2.0.3
Chrome : 61.0.3163.100
Node : 8.9.3
apm --version
apm 1.19.0
npm 3.10.10
node 6.9.5 x64
atom 1.28.0
python 3.6.4
git 2.15.0.windows.1
visual studio
The OS is Windows 10 Pro 64-bit, version 1803 (build 17134.112).
Additional Information
This does not occur on a dot that begins a line (or follows a space), only for a dot that follows text. I feel like the intended behaviour might be the opposite (should only suggest following a space or newline), i.e. there might be an inverted conditional.
I believe this to be a bug, but if the behaviour is intended, I would like to turn it off (just the "self" suggestion), in which case please consider it a feature request. I believe it's part of the langugage-python
package, as it occurs in safe mode, and only in Python files, so apologies if I've gotten this wrong.
A very annoying behavior indeed!
For what it's worth, I've also noticed this behavior and I'm running a Mac OS on High Sierra (10.13.6). Atom version 1.28.1 x64 .
(It's been driving me crazy for weeks, which is the only reason that I'm still doing the bulk of my coding in VSCode instead of switching over)
Looks like it might have to do with:
'.source.python:not(.string)':
'self':
'prefix': '.'
'body': 'self.'
in https://github.com/atom/language-python/blob/master/snippets/language-python.cson
A temporary way around this issue might be to locally disable the incriminated snippet. Users can add this to their ~/.atom/snippets.cson:
'.source.python:not(.string)':
'self':
'prefix': '.'
disabled: true
@j2bbayle: this is a lifesaver :)
A temporary way around this issue might be to locally disable the incriminated snippet. Users can add this to their ~/.atom/snippets.cson:
'.source.python:not(.string)': 'self': 'prefix': '.' disabled: true
Thank you!