FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fixing bug where native.exe --<tab> would not call native completer by powercode · Pull Request #3633 · PowerShell/PowerShell · GitHub

Fixing bug where native.exe --<tab> would not call native completer - #3633

Merged
Jason Shirk (lzybkr) merged 8 commits into
PowerShell:masterfrom
powercode:native-arg-hyphen
Jun 7, 2017
Merged

Fixing bug where native.exe --<tab> would not call native completer#3633
Jason Shirk (lzybkr) merged 8 commits into
PowerShell:masterfrom
powercode:native-arg-hyphen

Conversation

Staffan Gustafsson (powercode) commented Apr 24, 2017
edited
Loading

Copy link
Copy Markdown
Collaborator

A case was missing when parsing the processing the current token. The result was that the registered argument completer for a native command was not called if the wordToComplete was '--'.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Please use our common template:
Describe "TabCompletion"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Closed.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I believe the template more readable:
It "Completes native commands with '-'" {

Below too.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Closed.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

If we don't clean up completers after each test we should move all Register-ArgumentCompleter in BeforeAll block.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Please remove extra line.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Closed.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Please add Newline at EOF.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Closed.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

We could use C# 7.0 pattern here too. It is better use common pattern in whole file.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

The same about c# 7.0 pattern.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

The same about c# 7.0 pattern.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

The same about c# 7.0 pattern.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

The same about c# 7.0 pattern.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Closed.

Copy link
Copy Markdown
Collaborator

Staffan Gustafsson (@powercode) Please add description in the PR. This can be useful for documentation.

Copy link
Copy Markdown
Collaborator Author

Ilya (@iSazonov) Thanks for the review.
I've addressed your comments, except for the one about the registration of TabCompleters.
These are stored in private variables in the ExecutionContext, and as far as I know, there is no way to Unregister-ArgumentCompleter. Jason Shirk (@lzybkr) ?

Copy link
Copy Markdown
Collaborator

I think it's even better for tests to register several TabCompleters in BeforeAll and not remove them.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Looks gorgeous! 👍

I'd like to see the same everywhere below. Now there are too many use cases for "as" and "?"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

For information only. Personally I do not like to use "?" in if(). Expanded condition looks much clearer.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Please remove extra line.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Closed.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Please remove extra line.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Closed.

Staffan Gustafsson added 6 commits April 25, 2017 08:30

Copy link
Copy Markdown
Collaborator Author

Rebased master and fixed conflicting test/powershell/Host/TabCompletion/TabCompletion.Tests.ps1

Jason Shirk (lzybkr) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Would it be unreasonable to ask for logic code changes only?

The C# 7 language usage is nice, but I'd rather see those sorts of changes in a distinct PR.

Copy link
Copy Markdown
Collaborator

Sometimes mantainers aren't predictable - I just asked what I was getting myself.

Copy link
Copy Markdown
Contributor

Sometimes people aren't predictable.

PowerShell is no longer my full time job - so when I ask for something like this, it's to make things easier for me. It's already somewhat hard to keep up as a maintainer with an unrelated full time job and non-computer related responsibilities and hobbies.

If you could see our pre-GitHub history, you would certainly see that I've been guilty of changes like this, but I blame not having a good enough VCS to make it easier. So I have plenty of personal experience with the difficulties of looking at changes that mix style and logical changes - and I do think a cleaner and easier to understand history is valuable in the long run, even if it wasn't painful to review something like this in the short term.

Copy link
Copy Markdown
Collaborator

I meant that often we contribute and discuss before the appointment of mantainer and before his posts - so we can not predict a review style and facilitate the mantainer's work.
I believe our workflow process could be improved, I guess we could take more from the CoreCLR/CoreFX workflows.
/cc Joey Aiello (@joeyaiello)

Copy link
Copy Markdown
Contributor

Note that CoreFX says this:

DO NOT send PRs for upgrading code to use newer language features, though it's ok to use newer language features as part of new code that's written.

See here.

Copy link
Copy Markdown
Collaborator

Yes, they were more clearly writing the workflow. We have to do the same.

Copy link
Copy Markdown
Contributor


Context NativeCommand {
BeforeAll {
$nativeCommand = (Get-Command -CommandType Application -TotalCount 1).Name

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

It might be wiser to create an external command on testdrive and change the path, but that's a tiny bit annoying to make it portable, so I'll merge as is.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants


Back | FazBrowse Home | New Git URL