Skip to content

Feature/update snippets #116

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 22 commits into from
Apr 29, 2023

Conversation

EmilyGraceSeville7cf
Copy link
Contributor

@EmilyGraceSeville7cf EmilyGraceSeville7cf commented Apr 26, 2023

  • add snippets for almost all commands before fill
  • add snippets for almost all data types
  • add snippets for some operators
  • explain snippet naming convention

Snippets should not just provide access for some things, but allow reminding some syntax.

@EmilyGraceSeville7cf EmilyGraceSeville7cf marked this pull request as draft April 26, 2023 15:16
@fdncred
Copy link
Contributor

fdncred commented Apr 26, 2023

oh, nice! thanks so much for jumping in. this seems pretty useful!!!

@EmilyGraceSeville7cf EmilyGraceSeville7cf marked this pull request as ready for review April 27, 2023 09:01
@EmilyGraceSeville7cf
Copy link
Contributor Author

EmilyGraceSeville7cf commented Apr 27, 2023

@fdncred, do you think it worth to add snippets for sed, awk in future PRs even when Nushell coverts the most (maybe all) their functionality?

@fdncred
Copy link
Contributor

fdncred commented Apr 27, 2023

@fdncred, do you think it worth to add snippets for sed, awk in future PRs even when Nushell coverts the most (maybe all) their functionality?

I'd prefer to keep the snippets nushell specific. I'm not sure I'd want to add snippets for a bunch of bash commands.

@fdncred
Copy link
Contributor

fdncred commented Apr 27, 2023

Wow, what a lot of work you've put into this. I'm just wondering if these snippets will conflict with the current ide completion functionality we just added? I'm going to test it out in a little while but was wondering what you thought.

@EmilyGraceSeville7cf
Copy link
Contributor Author

Wow, what a lot of work you've put into this. I'm just wondering if these snippets will conflict with the current ide completion functionality we just added? I'm going to test it out in a little while but was wondering what you thought.

I don't think they will complete for now. Snippets tend to provide command combinations, like in cases where data is read from stdin. AFAIK, LSP doesn't do that. But even when it will, we can just remove snippets and allow LSP provide better suggestions. For instance, what can be done: LSP can automatically insert pipe and placeholder for previous command if the next one reads from stdin (but just when there is nothing before). Snippets can't perform such analysis. ;)

@fdncred
Copy link
Contributor

fdncred commented Apr 29, 2023

I finally got around to testing these. They're so cool!!! Thanks!

@fdncred fdncred merged commit 758ea68 into nushell:main Apr 29, 2023
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.

2 participants