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

Add analyzer for Environment.CurrentManagedThreadId #43257

Closed
jkotas opened this issue Oct 10, 2020 · 4 comments · Fixed by dotnet/roslyn-analyzers#4909 or #49393
Closed

Add analyzer for Environment.CurrentManagedThreadId #43257

jkotas opened this issue Oct 10, 2020 · 4 comments · Fixed by dotnet/roslyn-analyzers#4909 or #49393
Assignees
Labels
api-approved API was approved in API review, it can be implemented area-System.Runtime code-analyzer Marks an issue that suggests a Roslyn analyzer code-fixer Marks an issue that suggests a Roslyn code fixer help wanted [up-for-grabs] Good issue for external contributors
Milestone

Comments

@jkotas
Copy link
Member

jkotas commented Oct 10, 2020

Environment.CurrentManagedThreadId is more compact and efficient replacement of Thread.CurrentThread.ManagedThreadId pattern. This pattern is quite common. We should add analyzer and auto-fixer for this.

@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added area-System.Threading untriaged New issue has not been triaged by the area owner labels Oct 10, 2020
@jkotas jkotas added code-analyzer Marks an issue that suggests a Roslyn analyzer help wanted [up-for-grabs] Good issue for external contributors and removed area-System.Threading untriaged New issue has not been triaged by the area owner labels Oct 10, 2020
@ShreyasJejurkar
Copy link
Contributor

Hi @jkotas, do we need to include this code analyzer in this repo, OR in the Roslyn analyzer repo?

@stephentoub stephentoub added api-ready-for-review API is ready for review, it is NOT ready for implementation code-fixer Marks an issue that suggests a Roslyn code fixer labels Oct 11, 2020
@jkotas
Copy link
Member Author

jkotas commented Oct 11, 2020

The code for the analyzer should be in https://github.com/dotnet/roslyn-analyzers repo.

@ShreyasJejurkar
Copy link
Contributor

Yes @jkotas, as I already guessed! 😇

@terrajobst terrajobst added api-approved API was approved in API review, it can be implemented and removed api-ready-for-review API is ready for review, it is NOT ready for implementation labels Oct 20, 2020
@terrajobst
Copy link
Member

terrajobst commented Oct 20, 2020

Video

Makes sense. Should use the same diagnostic ID as #42948 (we already have one for ProcessId, we should reuse that).

@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Mar 11, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Apr 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api-approved API was approved in API review, it can be implemented area-System.Runtime code-analyzer Marks an issue that suggests a Roslyn analyzer code-fixer Marks an issue that suggests a Roslyn code fixer help wanted [up-for-grabs] Good issue for external contributors
Projects
None yet
7 participants