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

[csharp] Unused variable warning, but variable is written #2916

Closed
rhires opened this issue Feb 11, 2016 · 4 comments
Closed

[csharp] Unused variable warning, but variable is written #2916

rhires opened this issue Feb 11, 2016 · 4 comments
Assignees
Labels
upstream Issue identified as 'upstream' component related (exists outside of VS Code)

Comments

@rhires
Copy link

rhires commented Feb 11, 2016

image

I wanted to title this "It's not just a mouthwash!" but...
Anyway, this brought me back to making sure I knew about scope - when I have a variable outside of the if statement, and then reference it inside the if statement, the system shouldn't complain about that. It's perfectly valid syntax. Why does VSCode think my variable is unused?

This is a C# file (which the little info in the bottom info bar agrees with), running 0.10.8, on Mac OS X Yosemite. This appears to be a new issue.

@Tyriar
Copy link
Member

Tyriar commented Feb 11, 2016

The variable is assigned but not used, a warning is expected because technically the variable is still doing nothing.

var should be colored though, I can reproduce it. It looks like it's a problem with the "Dark (Visual Studio)" and "Light (Visual Studio)" themes.

@Tyriar Tyriar added the themes Color theme issues label Feb 11, 2016
@Tyriar Tyriar changed the title Variable scope not being seen properly Variable scope not being seen properly in Dark/Light (Visual Studio) themes Feb 11, 2016
@aeschli
Copy link
Contributor

aeschli commented Feb 11, 2016

Moving to OmniSharp for commenting on the warning on the variable.
@Tyriar Let's have a separate issue for the 'var' coloring.

@aeschli aeschli changed the title Variable scope not being seen properly in Dark/Light (Visual Studio) themes [csharp] Unused variable warning, but variable is written Feb 11, 2016
@aeschli
Copy link
Contributor

aeschli commented Feb 11, 2016

This issue was moved to dotnet/vscode-csharp#34

@aeschli aeschli closed this as completed Feb 11, 2016
@aeschli
Copy link
Contributor

aeschli commented Feb 11, 2016

I created #2919 for the coloring issue.

@aeschli aeschli added c# upstream Issue identified as 'upstream' component related (exists outside of VS Code) and removed themes Color theme issues labels Feb 11, 2016
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
upstream Issue identified as 'upstream' component related (exists outside of VS Code)
Projects
None yet
Development

No branches or pull requests

3 participants