You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
listNamedExpressions will not return the expected result #638
listNamedExpressions can return a flat array with strings that are names of the expressions. But expressions can be scoped and the same name can be used. Shouldn't listNamedExpressions have a scope argument to list all available expression in the context? Then listNamedExpressions(undefined) will return global scope or all named expressions in some other way?
Steps to reproduce
Add myName expression with scope Sheet 1
Add myName expression with scope Sheet 2
Add myName expression with global scope
What will listNamedExpressions return? We have a conflict for a simple array list of strings
Demo
it('listing named expressions',()=>{constengine=HyperFormula.buildFromSheets({'Sheet 1': [[]],'Sheet 2': [[]]})engine.addNamedExpression('myName','=42','Sheet 1')engine.addNamedExpression('myName','=42','Sheet 2')engine.addNamedExpression('myName','=42')constnamedExpressions=engine.listNamedExpressions()expect(namedExpressions).toEqual(['myName','myName',// ????])})
Ok, so this is more a feature request. Without argument or undefined we get global scope. This is compatible with scope arguments across API and will be backward compatible for this method.
What we're missing is an optional scope argument here to get named expressions for a scope?
Activity
izulin commentedon Apr 20, 2021
After examination, it seems that it only returns global ones.
wojciechczerniak commentedon Apr 20, 2021
Ok, so this is more a feature request. Without argument or
undefinedwe get global scope. This is compatible withscopearguments across API and will be backward compatible for this method.What we're missing is an optional
scopeargument here to get named expressions for a scope?