Repository navigation
Allow Custom Types to be used in type signatures - #19311
Merged
Merged
Conversation
Contributor
|
cool |
fdncred
reviewed
Oct 22, 2026
Contributor
There was a problem hiding this comment.
Review overview
🟡 Changes recommended
The new input check misses signatures that mix a custom type with other types, and which custom types can be named depends on what each plugin declares, so built-in and undeclared plugin types stay unknown while the LSP now suggests them.
Findings: 1
Open (12)
The input check is skipped when the signature mixes a custom type with anything else Only custom types that appear in a plugin signature can be named Built-in custom types can't be named, but the LSP now suggests them Custom types insidelist<...>oroneof<...>aren't found Each lookup scans every declaration and every plugin signature The plugin type is checked before the forward-reference check for type aliases Type parameters on a custom type give a generic unknown-type error The doc says Custom parses like Any, but it doesn't The comment says plugin custom types, but the check covers built-in ones tooscope commandssignature keys change with this line Two plugins with the same type name are treated as one type Tests don't cover the release-note example or the LSP
Notes from my clanker, checked on 80e617f. Built nu and nu_plugin_custom_values from the branch and ran the snippets above with nu -n --plugins. The polars and LSP points come from reading the code.
2 tasks done
Contributor
|
I think this will close #19315 too if we can make it work for all custom types. |
Contributor
|
Sounds good. thanks. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Description
Changes the way that custom types are exposed in order to allow them to be used in type signatures. This also enabled them to be resolved correctly in the LSP.
User-facing changes (Release notes)
Custom types in type signatures
Custom types, including those from all installed plugins, can now be used in type signatures and resolve correctly in the Nushell LSP. The following examples show custom types used in parameter and input/output type annotations:
Additional notes
closes #19315