rope icon indicating copy to clipboard operation
rope copied to clipboard

Incorrect inline refactoring with dictionary expansion

Open lieryan opened this issue 4 years ago • 0 comments

Describe the bug

Incorrect inline refactoring with dictionary expansion.

To Reproduce Steps to reproduce the behavior:

  1. Code before refactoring:
def main(arguments):
    foobar(workspace, **arguments[0])

def foobar(workspace, document_uri, range):
    return FooBarCls(workspace, document_uri, range)()
  1. Inline "foobar"

  2. Expected code after refactoring:

def main(arguments):
    document_uri, range = arguments[0]
    FooBarCls(workspace, document_uri, range)()
  1. Describe the error or unexpected result that you are getting
def main(arguments):
    FooBarCls(workspace, document_uri, range)()

which is invalid since document_uri and range is not a valid name inside main.

Editor information:

  • Project Python version: 3.9.5
  • Rope Python version: 3.9.5
  • Rope version: 0.20.1

lieryan avatar Oct 04 '21 15:10 lieryan