Skip to content

Symbol Refactoring is Broken #94

Closed
@DonJayamanne

Description

@DonJayamanne

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIssue identified by VS Code Team member as probable bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions