Skip to content

[BUG] Renaming variable breaks VAR definitions using equal sign #408

@Mercury37

Description

@Mercury37

Describe the bug
Renaming variables defined as follows breaks the variable definition:
VAR ${var} = var1

Steps To Reproduce
Steps to reproduce the behavior:

  1. Select variable (can be either reference or definition)
  2. Click F2 to rename
  3. Enter new name
  4. Check variable definition
*** Test Cases ***
Example
    VAR    ${var} =    var1
    Log    ${var}

Expected behavior
The variable is renamed and the variable definition remains valid.

Screenshots/ Videos
The name of the variable is changed in the definition, but also the equal sign, whitespace preceding it (if present) and the ${} around the variable disappear.

Code_3kKzAYXTkV.mp4

Logs
None.

Additional context
This does not happen when the VAR syntax is used without equal sign.

Desktop (please complete the following information):

  • VS Code Version: 1.98.2
  • RobotCode Version: 1.0.2
  • OS: Windows 10
  • Python Version: 3.12.1
  • RobotFramework Version: 7.2.2
  • Additional tools: robocop

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions