Skip to content

Add commands to set and unset ISE Compatibility features - #2335

Merged
TylerLeonhardt merged 19 commits into
PowerShell:masterfrom
corbob:makeISElike
Dec 13, 2019
Merged

Add commands to set and unset ISE Compatibility features#2335
TylerLeonhardt merged 19 commits into
PowerShell:masterfrom
corbob:makeISElike

Conversation

@corbob

@corbob Cory Knox (corbob) commented Nov 29, 2019

Copy link
Copy Markdown
Contributor

PR Summary

Someone on twitter suggested automating setting the ISE Compatibility settings. This adds a "PowerShell: Set ISE Compatibility" and "PowerShell: Unset ISE Compatibility" command. These commands will globally set the settings mentioned in the document.

Currently it does not set the keybindings. I've haven't yet explored if they are settable from code, or if they have to be set through the package.json.

Marking as WIP for now as I would like to explore the keybindings thing. I don't see any documentation that even implies we can dynamically set keybindings, only that they can be set through package.json.

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
@corbob Cory Knox (corbob) changed the title WIP: Add commands to set and unset ISE Compatibility features Nov 29, 2019
@corbob
Cory Knox (corbob) marked this pull request as ready for review November 29, 2019 06:00

@TylerLeonhardt TylerLeonhardt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looking awesome.

I will say that this is probably the easiest feature to write tests for.

Look at other feature tests for examples.

All you wanna test is:

  • call Enable ISE Mode method, verify settings changed
  • call Disable ISE Mode method, verify settings changed
Comment thread src/features/ISECompatibility.ts Outdated
Comment thread src/features/ISECompatibility.ts Outdated
Comment thread package.json Outdated
Comment thread package.json Outdated
@corbob

Copy link
Copy Markdown
Contributor Author
  • call Enable ISE Mode method, verify settings changed

  • call Disable ISE Mode method, verify settings changed

I will definitely see what I can do. I wasn't sure on this because when I was initially testing this my code was something like:

console.log(vscode.workspace.getConfiguration("workbench.activityBar").get("visible"));
vscode.workspace.getConfiguration("workbench.activityBar").update("visible", false, true);
console.log(vscode.workspace.getConfiguration("workbench.activityBar").get("visible"));

and the output in the console was true both times, so I didn't think it was setting. I suspect if our testing is waiting for the function to end before testing then it should be ok.

Comment thread src/features/ISECompatibility.ts Outdated
@TylerLeonhardt

Copy link
Copy Markdown
Member
Comment thread src/features/ISECompatibility.ts Outdated
Comment thread src/features/ISECompatibility.ts Outdated
Comment thread src/features/ISECompatibility.ts Outdated
Comment thread src/features/ISECompatibility.ts Outdated
Comment thread src/features/ISECompatibility.ts Outdated
Comment thread src/features/ISECompatibility.ts Outdated
Comment thread src/features/ISECompatibility.ts Outdated
Comment thread src/features/ISECompatibility.ts Outdated
Comment thread vscode-powershell.build.ps1
Comment thread test/features/ISECompatibility.test.ts
Some formatting changes due to vscode format document.
Remove option to hide PSIC
Check that user hasn't modified settings from ISE settings before returning them to default.
Add interface for settings.
Caveat: This is sometimes inconsistent if there were compile errors. Sometimes need to run Invoke-Build Clean before Invoke-Build Test will pick up code changes.
Comment thread vscode-powershell.build.ps1
@TylerLeonhardt

Copy link
Copy Markdown
Member

Ok there we go. The macOS test failure is from API rate limiting that I need to fix. Rob Holt (@rjmholt) can you rereview?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants