Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Symbol Refactoring is Broken #94

Closed
DonJayamanne opened this issue Nov 13, 2017 · 4 comments
Closed

Symbol Refactoring is Broken #94

DonJayamanne opened this issue Nov 13, 2017 · 4 comments
Labels
bug Issue identified by VS Code Team member as probable bug

Comments

@DonJayamanne
Copy link

From @sgtoj on March 15, 2017 14:52

Environment data

VS Code version: 1.10.2 (and latest Insiders)
Python Extension version: 0.6.0
Python Version: 3.6.0
OS and version: Windows 10

Actual behavior

Symbol renaming will fail or rename symbol before the intended to be edited. This issue only occurs if End of Line Sequence is set to CRLF.

Expected behavior

Rename the intended symbol correct with LF and CRLF line endings.

Steps to reproduce:

Try renaming a symbol in the following file...

# -*- coding: utf-8 -*-
"""Bug Workspace"""

class Test():
    """Test Class"""

    def __init__(self):
        self._name = 'FooBar'
        self._modt = 'Hello World!'
        self._isbug = True

    @property
    def name(self) -> str:
        """Name"""
        return self._name

    @property
    def modt(self) -> str:
        """Message of the Day"""
        return self._name

    @property
    def isbug(self) -> bool:
        """Is Bug"""
        return self._isbug

    def do_something(self) -> str:
        """Do Something"""
        return 'Something is not right here.'


def main():
    """Script Entry"""
    test = Test()
    print(test.name)
    print(test.modt)
    print(test.isbug)


if __name__ == '__main__':
    main()

Workspace Settings

{
    "python.linting.pylintEnabled": true,
    "python.formatting.provider": "yapf"
}

User Settings

{
    "python.workspaceSymbols.enabled": true,
    "python.workspaceSymbols.ctagsPath": "C:\\ctags\\ctags",
    "python.workspaceSymbols.tagFilePath": "${workspaceRoot}\\.vscode\\tags",
}

Copied from original issue: DonJayamanne/pythonVSCode#824

@DonJayamanne
Copy link
Author

From @ajmathews on March 18, 2017 0:58

Appears to be similar to the problem I had
#802

@DonJayamanne
Copy link
Author

From @ghost on August 10, 2017 6:44

Any fix for this? It has been reported several times #875 #885 #902 #986 #991 #1081
For me the rename never works so I always have to do it with select/replace.

Thanks for looking into this!

@brettcannon brettcannon added awaiting 2-PR bug Issue identified by VS Code Team member as probable bug and removed awaiting 2-PR labels Nov 14, 2017
@TopherGopher
Copy link

+1 on this -
I see the debug message at the top saying Rename failed, but the error text is cut-off. If you could let me know where to get the full output, I'd be happy to provide.

@brettcannon
Copy link
Member

I just did a renaming of the following code with CLRF line endings and it worked for any position of the E variable:

def fxn():
    E = 42
    Y = E + 13
    return E + Y

Now there is also #52 where renaming appears to be flaky, so it's also possible you have bumped into that. So I'm going to close this as a duplicate of that other issue.

@lock lock bot locked as resolved and limited conversation to collaborators Jul 12, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug
Projects
None yet
Development

No branches or pull requests

3 participants