Skip to content

Add commands to set and unset ISE Compatibility features #2335

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

Merged
merged 19 commits into from
Dec 13, 2019
Merged

Add commands to set and unset ISE Compatibility features #2335

merged 19 commits into from
Dec 13, 2019

Conversation

corbob
Copy link
Contributor

@corbob corbob commented Nov 29, 2019

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

@TylerLeonhardt TylerLeonhardt left a comment

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

@corbob
Copy link
Contributor Author

corbob commented Nov 30, 2019

  • 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.

@TylerLeonhardt
Copy link
Member

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.
@TylerLeonhardt
Copy link
Member

Ok there we go. The macOS test failure is from API rate limiting that I need to fix. @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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants