-
Notifications
You must be signed in to change notification settings - Fork 9
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
Add Snippets #55
Add Snippets #55
Conversation
Remove line in downloadPSES.ps1 that doesn't actually do anything ($dir is never set) Add to ignore Snippets directory as we're pulling that from vscode-powershell.
@@ -1,5 +1,6 @@ | |||
*.zip | |||
PowerShellEditorServices/ | |||
Snippets/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we ship the snippets directly? :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the idea of piggy-backing off of the work done for vscode-powershell, and when the package.json is updated to have the snippets in there, it should ship them with the npm...
That being said, I think we can contribute multiple snippet files, so perhaps we can include a snippets file of our own?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it makes sense to allow for multiple entries, or even custom entries in user-defined directories.
I'll poke around to see if there's a way to programmatically add snippets without populating package.json ahead of time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can also create quick ps module that would be adding snippets to PowerShell.json, so users can either update it manually or add their custom snippets. Like New-VimSnippet/Remove-VimSnippet/Import-VimSnippet (similar to ISE)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know vscode has a concept of user-defined snippets, I wouldn't be surprised if coc.nvim has it as well.
That'd be the best place a New-VimSnippet
could target by default.
@corbob do you wanna move this out of draft now? Is it ready? |
I think it's mostly good. The only thing I think should be added is a note to the readme about needing coc-snippets. I'll update it later tonight or tomorrow and then move it out of draft. |
I did just notice a note that this needs nvim 0.4 or the latest vim8: https://github.com/neoclide/coc.nvim/wiki/F.A.Q#how-to-make-preview-window-shown-aside-with-pum which I've mentioned in the readme. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
LGTM! I've had a peek into coc-snippets, this is how it scans for snippets: So, if we modify the configuration setting |
Let's merge the current version first. I'm poking around this idea and we can do it in another PR. |
Fixes #51
Still need to actually create the snippets entry in
Package.json
.