-
Notifications
You must be signed in to change notification settings - Fork 8k
Refactor CompletionHelpers HandleDoubleAndSingleQuote to have less nesting logic
#25179
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
Refactor CompletionHelpers HandleDoubleAndSingleQuote to have less nesting logic
#25179
Conversation
|
Have we tests covering the method? |
@iSazonov So currently no tests other than tests covering the command completion. I can include XUnit tests in another PR then this one can be covered. |
|
Test will be covered in #25181 if we want to merge that in first. |
|
Waiting tests... |
src/System.Management.Automation/engine/CommandCompletion/CompletionHelpers.cs
Outdated
Show resolved
Hide resolved
src/System.Management.Automation/engine/CommandCompletion/CompletionHelpers.cs
Outdated
Show resolved
Hide resolved
src/System.Management.Automation/engine/CommandCompletion/CompletionHelpers.cs
Show resolved
Hide resolved
src/System.Management.Automation/engine/CommandCompletion/CompletionHelpers.cs
Outdated
Show resolved
Hide resolved
…letionHelpers.cs Co-authored-by: Ilya <darpa@yandex.ru>
|
I'll look into test failures for this one. |
| bool hasBackSingleQuote = backQuote.IsSingleQuote(); | ||
| bool hasBackDoubleQuote = backQuote.IsDoubleQuote(); | ||
|
|
||
| bool hasMatchingFrontAndBackQuote = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe hasBothFrontAndBackQuotes ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| return quoteInUse; | ||
| } | ||
|
|
||
| bool hasValidFrontQuoteAndNoMatchingBackQuote = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe hasFrontQuoteAndNoBackQuote?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
|
📣 Hey @ArmaanMcleod, how did we do? We would love to hear your feedback with the link below! 🗣️ 🔗 https://aka.ms/PSRepoFeedback |
PR Summary
Refactor
HandleDoubleAndSingleQuotemethod to have less nesting logic so it is easier to understand.The current code is very hard to understand in comparison to the flatter version which has less nesting and more clearer variable names and intention.
Obviously just a preference, I am happy to close this PR if people don't find the new refactoring an improvement.
PR Context
PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright headerWIP:or[ WIP ]to the beginning of the title (theWIPbot will keep its status check atPendingwhile the prefix is present) and remove the prefix when the PR is ready.- [ ] Issue filed:
(which runs in a different PS Host).