Skip to content
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

don't return anything from toolkit command #992

Merged
merged 2 commits into from
Dec 12, 2024

Conversation

a-stevan
Copy link
Contributor

i get the following LSP error in my editor, because it's true main does not return a string 🤔

image

in this PR, i propose to truely return nothing from this main command by printing the help page.

alternative

we could also change the signature to nothing -> string

@fdncred
Copy link
Collaborator

fdncred commented Dec 12, 2024

I think it's better to change it to nothing -> string since it is true that help should return a string.

@a-stevan
Copy link
Contributor Author

sure can do 😉

@a-stevan
Copy link
Contributor Author

mm i think there is an issue with my config, i have written a replacement for help which uses a pager when the help page is too long, and Nushell thinks the help inside toolkit.nu is mine instead of the builtin one...

this is not an issue with the nu_scripts so i'll apply the change anyways

@fdncred fdncred merged commit cc62dd7 into nushell:main Dec 12, 2024
1 check passed
@fdncred
Copy link
Collaborator

fdncred commented Dec 12, 2024

Thanks

@a-stevan a-stevan deleted the fix-toolkit branch December 12, 2024 14:11
NotTheDr01ds pushed a commit to NotTheDr01ds/nu_scripts-fork that referenced this pull request Dec 20, 2024
i get the following LSP error in my editor, because it's true `main`
does not return a `string` 🤔


![image](https://github.com/user-attachments/assets/787f62f8-ef66-4ac4-ba30-c396d3cdd4d2)


in this PR, i propose to truely return `nothing` from this _main_
command by `print`ing the help page.

### alternative
we could also change the signature to `nothing -> string`
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