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

Deconstructed local variable isn't underlined if it's reassigned exactly once in a local function #76570

Open
vsfeedback opened this issue Dec 26, 2024 · 0 comments
Labels
Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead

Comments

@vsfeedback
Copy link

This issue has been moved from a ticket on Developer Community.


[severity:It's more difficult to complete my work]

Tested on VS 17.12.1 and dotnet 9.0.100.

Copy the following sample program into an empty console project, and open the project with VS2022. Make sure that the "Underline reassigned variables" option is enabled in Options | Text Editor | C# | Advanced.

The expected and displayed formatting is described in comments. Duplicating, e.g., b = 2; will cause all occurrences of b to be underlined, as expected.

var a = 0; // Correctly shown as a̲
var (b, c) = (0, 0); // Shown as (b, c), should be (b̲, c̲)

Foo();
Console.WriteLine($"{a} {b} {c}"); // Shown as {a̲} {b} {c}, should be {a̲} {b̲} {c̲}

void Foo() {
  a = 1; // Correctly shown as a̲
  b = 2; // Shown as b, should be b̲
  if (Environment.TickCount > 12345)
      c = 1; // Shown as c, should be c̲
  else
      c = 2; // Shown as c, should be c̲
}

Original Comments

Feedback Bot on 11/19/2024, 07:50 PM:

We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Dec 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead
Projects
None yet
Development

No branches or pull requests

1 participant