Skip to content

Conversation

adamgerhant
Copy link
Collaborator

@adamgerhant adamgerhant commented Aug 30, 2025

Refactor how the editor handles type queries with an improved TypeSource enum and helper functions to reduce code duplication, better represent state, and prevent code duplication with a more abstracted interface.

Fixes the valid types list, but also removed it since it is now too computationally expensive. It will be readded when the tooltips are moved into the editor.

/// Represents the result of a type query for an input or output connector.
#[derive(Debug, Clone, PartialEq)]
pub enum TypeSource {
	// A type that has been compiled based on all upstream types
	Compiled(Type),
	// The type of value inputs
	TaggedValue(Type),
	// A type that is guessed from the document node definition
	DocumentNodeDefinition(Type),
	// When the input is not compiled, the type is unknown and must be guessed from the valid types
	Unknown,

	Error(&'static str),
}

Depends on #3152

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.

1 participant