Add null-ckeck analyzer and code fix#43
Open
s-arash wants to merge 3 commits intoDustinCampbell:masterfrom
Open
Add null-ckeck analyzer and code fix#43s-arash wants to merge 3 commits intoDustinCampbell:masterfrom
s-arash wants to merge 3 commits intoDustinCampbell:masterfrom
Conversation
-Add the analyzer and code fix classes -Add related unit tests -Modify readme.md to showcase the new feature
…upport batch fixing
Owner
|
@s-arash, my apologies for not getting to this sooner! FWIW, we actually delivered this feature in the last update to Visual Studio 2015. So, you shouldn't need it C# Essentials. |
Author
|
@DustinCampbell as far as I know, Visual Studio only looks for delegate invocation if (SomethingHappened != null) SomethingHappened(this, args);
// -->
SomethingHappened?.Invoke(this,args);This code fix looks for other cases where null conditional access can be used to simplify code. Unless I'm missing something obvious, that is the situation. |
Owner
|
Ah yes, you are correct. Sorry about that! |
| <Reference Include="Microsoft.CodeAnalysis.Workspaces, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> | ||
| <HintPath>..\..\packages\Microsoft.CodeAnalysis.Workspaces.Common.1.0.0\lib\net45\Microsoft.CodeAnalysis.Workspaces.dll</HintPath> | ||
| </Reference> | ||
| <Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" /> |
…ols.UnitTestFramework that somehow snuck in.
Author
|
No problem! |
|
Is this going to get merged in?! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
-Add the analyzer and code fix classes
-Add related unit tests
-Modify readme.md to showcase the new feature
The analyzer looks for cases like this:
and the code fix converts them to:
It recognizes more complex syntax too.
--->