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

[Bug]: Invalid variable renaming in Vs code action #40130

Open
SasinduDilshara opened this issue Apr 6, 2023 · 3 comments
Open

[Bug]: Invalid variable renaming in Vs code action #40130

SasinduDilshara opened this issue Apr 6, 2023 · 3 comments
Assignees
Labels
Area/CodeAction Language Server Code Actions Points/3 Equivalent to three days effort Priority/High Status/Blocked Team/LanguageServer Language Server Implementation related issues. #Compiler Type/Bug

Comments

@SasinduDilshara
Copy link
Contributor

Description

Consider following code sample

import ballerina/lang.regexp;

public function main() {
    regexp:RegExp _ = re `(?${""}:)`;
    3;
}

When we select the create variable code action for second statement, the renaming option contains invalid variable name.

Screenshot 2023-04-06 at 16 46 21

Steps to Reproduce

No response

Affected Version(s)

No response

OS, DB, other environment details and versions

No response

Related area

-> Compilation

Related issue(s) (optional)

No response

Suggested label(s) (optional)

No response

Suggested assignee(s) (optional)

No response

@SasinduDilshara SasinduDilshara added Type/Bug Team/LanguageServer Language Server Implementation related issues. #Compiler Area/CodeAction Language Server Code Actions labels Apr 6, 2023
@SasinduDilshara
Copy link
Contributor Author

SasinduDilshara commented Apr 6, 2023

Another issue in variable renaming.
When we select create variable code action and rename our variable to _, vs code give two choices, first one is keep the variable as _ or keep the variable as '_.
When we choose '_, the code gives compile time error '_' is a keyword, and may not be used as an identifier(BCE3107)

public function main() {
    int '_ = 3; // '_' is a keyword, and may not be used as an identifier(BCE3107
}

@mindula
Copy link
Contributor

mindula commented Jul 7, 2023

related issue #40525

@KavinduZoysa KavinduZoysa added the Points/3 Equivalent to three days effort label Jul 13, 2023
@mindula mindula moved this from BackLog to In Progress in Ballerina Team Main Board Aug 23, 2023
@mindula
Copy link
Contributor

mindula commented Aug 24, 2023

Blocked by #41282

@mindula mindula moved this from In Progress to On Hold in Ballerina Team Main Board Aug 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area/CodeAction Language Server Code Actions Points/3 Equivalent to three days effort Priority/High Status/Blocked Team/LanguageServer Language Server Implementation related issues. #Compiler Type/Bug
Projects
None yet
Development

No branches or pull requests

4 participants