Extract Method: top level method that is static should create a static extraction#58021
Merged
akhera99 merged 8 commits intodotnet:mainfrom Mar 15, 2022
Merged
Conversation
| { | ||
| if (method.IsStatic) | ||
| { | ||
| tokens.Add(SyntaxFactory.Token(SyntaxKind.StaticKeyword)); |
Contributor
There was a problem hiding this comment.
this feels odd. shouldn't this always be added if hte method is static? to the point that i think we could just have this check before everything else, and unilaterally add 'static' (regardless oc ompilation-unit/type/interface destinatino). thoughts?
Contributor
There was a problem hiding this comment.
hrmm... i see. there's an issue of wanting to avoid things like accessibility.
Contributor
There was a problem hiding this comment.
i think this should move up to line 281 and become an 'else' of htat condition.
Youssef1313
reviewed
Nov 30, 2021
| } | ||
| } | ||
|
|
||
| if (destination is CodeGenerationDestination.CompilationUnit) |
Member
There was a problem hiding this comment.
Why not replace the following condition (around line 239):
if (destination is not CodeGenerationDestination.CompilationUnit and
not CodeGenerationDestination.Namespace and
not CodeGenerationDestination.InterfaceType)with
if (destination is not CodeGenerationDestination.Namespace and
not CodeGenerationDestination.InterfaceType)
Contributor
There was a problem hiding this comment.
so compilation unit locations can't support things like accessibility.
CyrusNajmabadi
approved these changes
Nov 30, 2021
ryzngard
approved these changes
Nov 30, 2021
…at I didn't touch
…13_extract_method
CyrusNajmabadi
approved these changes
Mar 15, 2022
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.
Fixes: #58013