开发者

How To Edit PyDev Quick Fix Templates?

开发者 https://www.devze.com 2023-04-12 15:21 出处:网络
I am developing a class in PyDev and as I am writing the __init__(self) method I realize I need to call another method.Within __init__ I simply type self.otherMethod(param) then press Ctrl+1 and the Q

I am developing a class in PyDev and as I am writing the __init__(self) method I realize I need to call another method. Within __init__ I simply type self.otherMethod(param) then press Ctrl+1 and the Quick Fix window appears suggesting several option including Create otherMethod method at A. When I choose to create the otherMethod method, the following code is automatically generated:

def otherMethod(self,param):开发者_运维知识库
pass

For Python, the indentation of this is incorrect. Is there a way to edit the template for Quick Fix? This particular template is not available under Preferences -> PyDev -> Editor -> Templates.

class A:
    def __init__(self):
        self.otherMethod(param)

    def otherMethod(param):
    pass

Thanks in advance for your help.


Those quick fixes are currently hard-coded, so, they cannot be editable... I went on to try to fix your use-case but I couldn't reproduce it in PyDev 2.2.3, so, please try upgrading (if you're not in the latest PyDev) or if you're already in the latest version, please create a bug-report with instructions to reproduce it (see: http://pydev.org/about.html for the proper place to create a bug-report).

0

精彩评论

暂无评论...
验证码 换一张
取 消