atom / language-python

Python package for Atom
Other
190 stars 146 forks source link

Classname in Snippets broken after update. #249

Closed malarinv closed 6 years ago

malarinv commented 6 years ago

Prerequisites

Description

Snippet for class,property are generating invalid code.

Steps to Reproduce

  1. create a empty python file with atom
  2. type class[tab][tab]

Expected behavior: It should have generated the following

class ClassName|(object):
    """docstring for ClassName|."""
    def __init__(self, arg):
        super(ClassName|, self).__init__()
        self.arg = arg

Actual behavior: generates the following

class ClassName|(object):
    """docstring for [object Object]."""
    def __init__(self, arg):
        super([object Object], self).__init__()
        self.arg = arg

Reproduces how often: Always

Versions

Atom : 1.25.1 Electron: 1.7.11 Chrome : 58.0.3029.110 Node : 7.9.0

apm 1.19.0 npm 3.10.10 node 6.9.5 x64 atom 1.25.1 python 2.7.14 git 2.10.1

Arcanemagus commented 6 years ago

It looks like this regressed since Atom v1.24.1, as this is what you get in that version: image

lee-dohm commented 6 years ago

May be related to https://github.com/atom/snippets/pull/267. @Arcanemagus can you double check this to see if it would be fixed by that PR?

Arcanemagus commented 6 years ago

I can confirm that a version of Atom that includes that PR works fine when inserting that snippet ๐ŸŽ‰.

This has already been fixed in https://github.com/atom/snippets/pull/267. It was merged into Atom in https://github.com/atom/atom/commit/067add71f8147d3864e3885eadecf0f7052ca299 ๐Ÿ˜‰.

Thanks for reporting this!

Arcanemagus commented 6 years ago

This has been released in Atom v1.26.0-beta2.