mirror of
https://github.com/enso-org/enso.git
synced 2024-11-22 22:10:15 +03:00
Consider autoscoped name when looking up dynamic config (#9916)
Fixes #9635 @JaroslavTulach with this change you reproduction scenario works as it should. https://github.com/enso-org/enso/assets/6566674/89ecaae4-c5e5-437a-8ff2-3e77ccb0a67c
This commit is contained in:
parent
43c80da8a3
commit
52b8ed4d3a
@ -9,8 +9,12 @@ import { toValue } from 'vue'
|
||||
// other recently-created nodes have rendered and computed their real sizes.
|
||||
export const DEFAULT_NODE_SIZE = new Vec2(300, 32)
|
||||
|
||||
const orDefaultSize = (rect: Rect) =>
|
||||
rect.width !== 0 ? rect : new Rect(rect.pos, DEFAULT_NODE_SIZE)
|
||||
const orDefaultSize = (rect: Rect) => {
|
||||
if (rect.width !== 0 && rect.height !== 0) return rect
|
||||
const width = Math.max(rect.width, DEFAULT_NODE_SIZE.x)
|
||||
const height = Math.max(rect.height, DEFAULT_NODE_SIZE.y)
|
||||
return new Rect(rect.pos, new Vec2(width, height))
|
||||
}
|
||||
|
||||
type ToValue<T> = MaybeRefOrGetter<T> | ComputedRef<T>
|
||||
|
||||
|
@ -157,8 +157,9 @@ const inheritedConfig = computed(() => {
|
||||
if (props.input.dynamicConfig?.kind === 'OneOfFunctionCalls' && methodCallInfo.value != null) {
|
||||
const cfg = props.input.dynamicConfig
|
||||
const info = methodCallInfo.value
|
||||
const name = entryQn(info?.suggestion)
|
||||
return cfg.possibleFunctions.get(name)
|
||||
const fullName = entryQn(info?.suggestion)
|
||||
const autoscopedName = '..' + info?.suggestion.name
|
||||
return cfg.possibleFunctions.get(fullName) ?? cfg.possibleFunctions.get(autoscopedName)
|
||||
}
|
||||
return undefined
|
||||
})
|
||||
|
@ -128,7 +128,7 @@ export interface FunctionCall {
|
||||
export interface OneOfFunctionCalls {
|
||||
kind: 'OneOfFunctionCalls'
|
||||
/** A list of possible function calls and their corresponding configuration.
|
||||
* The key is typically a fully qualified name of the function, but in general it can be anything,
|
||||
* The key is typically a fully qualified or autoscoped name of the function, but in general it can be anything,
|
||||
* depending on the widget implementation. */
|
||||
possibleFunctions: Map<string, FunctionCall>
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user