★ wanayoo — archive 1999 https://github.com/PowerShell/vscode-powershell/pull/1972Nouvelle recherche | Portail wanayoo
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

WIP: Add WebView to Insert Command from Command Explorer #1972

Draft
wants to merge 27 commits into
base: master
from

Conversation

@corbob
Copy link
Contributor

@corbob corbob commented May 21, 2019

PR Summary

Add a WebView for Inserting command selected from Command Explorer.

Currently mimics Show-Command in that it handles switches and text (switches don't get $true appended, and text is encapsulated in quotation marks if a space is involved).

WIP: Show-Command handles ValidateSet with a drop down. Would like to add this functionality before merging.

PR Checklist

Note: Tick the boxes below that apply to this pull request by putting an x between the square brackets.
Please mark anything not applicable to this PR NA.

  • PR has a meaningful title
  • Summarized changes
  • PR has tests
  • This PR is ready to merge and is not work in progress
    • If the PR is work in progress, please add the prefix WIP: to the beginning of the title and remove the prefix when the PR is ready
@TylerLeonhardt
Copy link
Member

@TylerLeonhardt TylerLeonhardt commented Jun 2, 2019 •

Will review after I get back from vacation. P.S. I would really recommend attempting to add tests. It may be possible to mock the LSP requests to PSES. Also here's an example of how I referenced a type that isn't exported

https://github.com/PowerShell/vscode-powershell/blob/master/test/features/CustomViews.test.ts#L11-L14

@corbob corbob force-pushed the corbob:CommandExplorerv2 branch from 68724cd to 4e3f91d Jun 4, 2019
@TylerLeonhardt
Copy link
Member

@TylerLeonhardt TylerLeonhardt commented Jun 25, 2019

@corbob can you add some pictures or a gif of what this looks like since it's UI related?

media/insert.html Outdated Show resolved Hide resolved
media/style.css Outdated Show resolved Hide resolved
@TylerLeonhardt
Copy link
Member

@TylerLeonhardt TylerLeonhardt commented Jun 25, 2019 •

Generally I think it might be worth thinking about how you could write tests for this. VSCode does a great job at allowing us to take advantage of an open instance of VSCode in our tests so the vscode.* APIs all work.

My initial thought is, the InsertCommand method could be tested.
If you refactor the BuildCommand function a bit to return the built command, you could test that.

If you look at some of the CustomView tests, you can get an idea for how to reach in and call private methods.

@corbob corbob force-pushed the corbob:CommandExplorerv2 branch from 4e3f91d to 2d5f204 Jul 23, 2019
@corbob corbob force-pushed the corbob:CommandExplorerv2 branch 2 times, most recently from a7740a4 to bcff483 Feb 10, 2020
@corbob corbob force-pushed the corbob:CommandExplorerv2 branch from 5d8d152 to d4bfd3f May 12, 2020
corbob added 19 commits Jan 31, 2019
This allows the user to move the window and not lose the information they've entered.
Make sure only a single set of Common Parameters.
Needs to be encoded as UTF8 *without* BOM
for codacy...
How was this missed by Codacy before???
How was this missed by Codacy before???

Also the one that Codacy actually mentioned...
Make Mandatory Parameters Required.
Implement for-of loops to make it clearer
Correctly check if Mandatory parameter.
Correctly check for ValidateSets.
Tidy up Arrow functions (by converting to for-of loops.
@corbob corbob force-pushed the corbob:CommandExplorerv2 branch from d4bfd3f to 6e23ba6 Aug 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.