-
Notifications
You must be signed in to change notification settings - Fork 511
Modernize built-in snippets #3839
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
Conversation
@andschwa first pass done. There's a lot of things here that I think are more community questions: Should we retain legacy snippets for deprecated and discouraged features like workflows, should we retain pester now that it's no longer bundled with PS, etc. All of which keeping in mind there is the community snippets section of docs, though I think it would warrant just being another mini-extension maybe. |
@andschwa Build failure is not me:
|
Fixed it! Sorry about that. 😅 Give it a rebase and it should work. This is looking great! |
8136a84
to
496f912
Compare
I rebased it! |
Should be good to go. A lot of these snippets support the vscode "snippet in place" method now. For example, type I removed a lot of snippets based on my opinion and on some polling, need more opinions however as to should these stay with the "core" extension or should instead ship either as a community snippets extension or just provided guidance within the existing community snippets markdown file. |
@JustinGrote do you know what this issue means: #3404 ? 😂 |
Disregard, I was mistaken, this is part of the snippet itself. It can be configured either way, but we should decide if we are going to change the consensus on whether $ is considered a word separator or not (e.g. double clicking Ultimately I'd like to see the snippets converted to completions for multiple reasons:
But this PR just an easy first step to modernization |
Also I personally am team "$ is not a word separator" mostly because it makes double-click + ctrl-f2 to rename all symbols more error prone, unless we come up with a way to do a proper rename symbol in Powershell |
Eh, sure, if we have that setup.
I'm down to remove them. They could be in a help file if we wanted.
You'd be the expert on this! Perhaps they should? But also everyone uses Pester with PowerShell, it's the default test framework really.
Sweet!
Sounds good to me!
Loving it! P.S. Sorry this took me a while to get to! Testing them out right now. |
496f912
to
c1c06ca
Compare
Thanks so much @JustinGrote! |
Evaluate and modernize existing snippets. This will be a breaking change in some cases, we should provide guidance for restoring existing snippets for any cranky people :).
After this PR, snippets may be further improved by moving them out of JSON definition and into typescript, the primary improvement being that we can define the description with a MarkdownString and include help links, etc. but how much of that should just be returned by the LSP vs. a snippet is TBD.
ArgumentCompleterAttribute ScriptBlock- Redundant and not useful since you cant use a variable with an ArgumentCompleterwith ScriptBlock- Renamed and more descriptive help added. Added final tabstop after argumentcompleterComment-HelpReplaced withFunction Help
Should DSC move to community snippets?
Example-Advanced Workflow- Workflows are deprecated, we should encourage parallel instead.Should we still have examples or should the examples be with placeholders?
Should Pester Move to Community Snippets since it is no longer bundled with Powershell?
Intellisense now handles the requires, there was a comment that these should be removed when it does.
Requires AssemblyRequires Assembly PathRequires Assembly VersionRequires ModuleRequires Module RequiredVersionRequires Module VersionRequires PSEditionRequires PSSnapinRequires PSSnapin VersionRequires RunAsAdministratorRequires ShellIdRequires VersionWorkflows are deprecated and not supported in 6+, we should not be encouraging their use.
WorkflowWorkflow ForEachParallelWorkflow InlineScriptWorkflow ParallelWorkflow SequenceNEW