Граф коммитов

1556 Коммитов

Автор SHA1 Сообщение Дата
Vamsi Modem ad24027103
Mark rule as async, if async NamedFormulas are used. (#233)
* initial commit

* added IsAsync to IExternalRule

* Added IsAsync property in NameLookupInfo

* NameLookupInfo changes

* PR Feedback

* PR Feedback
2022-03-22 16:42:27 -07:00
Greg Lindhorst bdef5ff5be
Make FeatureFlags accessible to hosts (#135)
Make FeatureFlags accessible to hosts

At present, a host can't modify the feature flags.  They should be able to.  For example, I'd like to be able to `FeatureFlags.StringInterpolation = true;` when instancing a new engine in the ConeoleREPL sample, to test out this feature without needing to build the libraries.

For extra protection - make flags only settable once.
Hosts should only use feature flags to try experimental features.
2022-03-22 14:36:39 -07:00
rick-nguyen a6b42afc11
Add Identifier to Error Messages (#163)
* initial commit

* fix tests to use new error message

* added separate error message

* address comments, add tests

* update tests for new error message
2022-03-22 13:42:49 -07:00
bryancroteau-MSFT 9f4ede9de2
Add GetRequiredEnumNames method to TexlFunction (#238) 2022-03-22 13:24:37 -07:00
McCall Saltzman 07b7b8214c
Add PowerFxConfig support for top level display names (#236)
* Top level display names with Resolver support

* Collision checks

* collision test

* Remove dictionary access to symbols

* remove internal environmentsymbol access
2022-03-22 11:41:23 -07:00
Mike Stall 119224583e
Add static analysis (via reflection) tests to look for mutable static… (#230)
Add static analysis (via reflection) tests to look for mutable static fields - these could cause issues for multi-threading scenarios.

This adds new tests, which includes exceptions for current suspicious behavior. Follow items to address these.  

It looks like it would be safe to have a recalc engines per thread, running independent.
2022-03-21 14:14:20 -07:00
bryancroteau-MSFT 268d693738
Rename ParseJson to ParseJSON (#229) 2022-03-18 17:47:24 -07:00
McCall Saltzman f53e9690e1
Expose OptionSet name, and correctly marshal in FormulaType.Build (#228)
* Expose OptionSet name, and handle in FormulaType.Build

* Test fix
2022-03-18 10:10:08 -07:00
Emily H 368222d3fd
Coercing only OptionSetValues to boolean for CountIf and LookUp (#210)
* Coercing only OptionSetValues to boolean for CountIf and LookUp

* Changed logic, updated test

* Added HasPreciseErrors to CountIf and updated unit tests

* Added HasPreciseErrors to LookUp

* Updated unit test
2022-03-17 20:37:38 -07:00
bryancroteau-MSFT c29a22faf7
Remove all arguments from the generated call node (#224) 2022-03-16 13:07:13 -07:00
Carlos Figueira 3096ab6bb3
Fix RandBetween to be equivalent to Excel (#222)
* Fix RandBetween to be equivalent to Excel

* Fix new tests
2022-03-16 07:40:17 -07:00
Om Prakaash 263d28995d
Added Tests for LazyEvalNode (#217)
* Added Tests for LazyEvalNode

Added tests to document Source-span errors for LazyEvalNodes in IR.

* Added file header to IRTranslatorTests

* Implemented code review suggestions and added tests

Implemented code review changes. Added new tests.

* Removed code format bugs

* Updated IRTranslator Tests

Updated IRTranslator tests.

* Update IRTranslatorTests.cs

Added tests to check ResultType in LazyEvalNode.

* Update IRTranslatorTests.cs

Implemented code review suggestions.

Co-authored-by: McCall Saltzman <69215460+lesaltzm@users.noreply.github.com>
Co-authored-by: bryancroteau-MSFT <84751645+bryancroteau-MSFT@users.noreply.github.com>
2022-03-15 12:58:25 -07:00
rick-nguyen 2b16f6faf9
Adding index function support for tables (#137)
* Add index function

* remove duplicate resources

* unit tests

* add to recalcengine, change texl runtime name for index_UO

* more test coverage

* add suggested tests/changes

* add function back to recalc engine
2022-03-15 12:14:57 -07:00
Joris de Gruyter aeb1811636
LookUp function (#212)
* LookUp function

* Remove individual txt references

* Revert "Remove individual txt references"

This reverts commit c8187bee06.

* Remove explicit text file references

* Remove superfluous condition

* Update from feedback with more tests

* no code path for args.Length>3, remove check

* Fix ErrorKind

* compiler error tests for arguments

Co-authored-by: McCall Saltzman <69215460+lesaltzm@users.noreply.github.com>
2022-03-15 11:48:18 -07:00
McCall Saltzman ff76d837a1
Unify FormulaType Json representation with other type definitions (#215)
* Unify FormulaType Json representation with other type definitions used by Canvas

* Public surface

* Case sensitive
2022-03-15 11:37:48 -07:00
Carlos Figueira b4c06c1aa1
Add support for Concat's third parameter (separator) (#220)
* Add support for Concat's third parameter (separator)
* PR feedback
2022-03-15 11:21:06 -07:00
toshio-msft 9ff36bacd0
[Automated] Localization hand-back [CTAS - RunID=20220315-172717-42a3kzc2c7] (#221)
Co-authored-by: Toshio Shimoaraiso <toshiosh@exchange.microsoft.com>
2022-03-15 10:41:42 -07:00
Carlos Figueira d43b11cfcc
Add trigonometric functions to C# interpreter (#218)
* Trig functions - first pass

* Updated implementation

* Implementation of Atan2

* More tests

* Split table trig tests from scalar ones
2022-03-15 10:18:14 -07:00
bryancroteau-MSFT d8d5e1b12b
Add new error for empty Islands (#216)
* Add new error for empty Islands

* Add empty string test

* Add comments for translation
2022-03-14 17:27:17 -07:00
Carlos Figueira d797e306e4
Fix error kind matching in test cases (#211) 2022-03-10 22:01:40 -08:00
Ian Legler 27493e7001
Add message key to expression error, allow custom name sanitization (#193)
* Add message key to expression error, allow custom name sanitization

* Update name provider contract to handle lookups
2022-03-10 14:50:16 -08:00
Carlos Figueira 5aa5b6fc64
Remove restriction for output behavior properties in components (#194)
* Remove restriction for output behavior properties in components
* Remove unused parameter
2022-03-10 10:17:51 -08:00
Carlos Figueira 45160e8545
Update local package version number (#209) 2022-03-09 11:32:18 -08:00
Carlos Figueira 0b45b45865
Revert "Allow CountIf and LookUp to coerce yes/no to Boolean (#187)" (#208)
* Revert "Allow CountIf and LookUp to coerce yes/no to Boolean (#187)"

This reverts commit 12b87ac778.

* Add test
2022-03-09 10:38:16 -08:00
Carlos Figueira 3aec136b84
Allow numeric enum variables to be used in Kind property for the Error function (#207)
* Allow numeric enum variables to be used in the Kind property for the Error function
2022-03-09 10:14:18 -08:00
bryancroteau-MSFT ca15e80df4
Add function info to generated call info (#206) 2022-03-08 15:53:35 -08:00
Mike Stall 4ebfd628ee
Add more error testing. (#205)
Add more error testing.
1. For #error tests that override BaseRunner.IsError, , run an IsError(x) test case too. 
2. Fix .txt test parser hole
2022-03-08 15:24:54 -08:00
bryancroteau-MSFT ebf6be1e94
Add new method to TexlBinding for generating transient Concatenate CallNodes (#203) 2022-03-08 13:49:27 -08:00
Mike Stall ed077fedcf
Fix testrunner to still call BaseRunner.IsError (#204)
Co-authored-by: Mike Stall <jmstall@microsoft.com>
2022-03-08 05:44:53 -08:00
Carlos Figueira b23a1fc8f3
Implement Error function, pass scope parameter to IfError, validate error kind (#202)
* Implement Error function, pass scope params to IfError
* Updated expected error values to validate the error kind
* Updated base runner to wait in a loop if under debugger
2022-03-07 15:30:02 -08:00
bryancroteau-MSFT a248d7b2f0
Fix while loop bug in the Mid function (#201) 2022-03-07 12:46:27 -08:00
Mike Stall fbd961e671
Tests: Remove .txt engine parsing (#200)
.txt updates

1. Better factoring of .txt to remove *all per-engine exception* in the .txt cases.  Use overrides instead. 
2. Remove .txt engine parsing support.
3. Update interpreter to use overrides.
2022-03-07 11:01:01 -08:00
Mike Stall e2d926f714
Update .txt runner for maintainability (#190)
"just" test updates for .txt runner, no product changes. 

1. Move away from /*engine*/ model and allow backend overrides, using #override and #disable directives. Will remove engines in the future once we migrate.
2. Fix some copy&paste bloat and properly share. 
- Factor to have the TxtFileDataAttribute (used for Xunit runner) share the .txt parser with existing TestRunner class.
- shared pass/fail/skip logic across runners
3. We now get test failure errors for timeouts (before test run hangs)
4. We now get test failures if there's a parse error or duplicate tests in the .txt.  (Enable some tests, called out by https://github.com/microsoft/Power-Fx/pull/184)
5. improved commenting for how to debug the Xunit integration.
6. Applies these to the interpreter. 


This has a breaking change to the BaseRunner contract.
2022-03-04 08:26:22 -08:00
Emily H 12b87ac778
Allow CountIf and LookUp to coerce yes/no to Boolean (#187)
* Allowed CountIf and LookUp to coerse yes/no to boolean

* Added to nodetocoercedtypemap

* removed redundant check
2022-03-03 16:07:15 -08:00
McCall Saltzman 1b461041a7
Small refactor to remove two unneded properties on IExternalDocumentProperties (#192) 2022-03-03 13:33:08 -08:00
McCall Saltzman 32e934fcca
Move lookup to builtinfunctionscore (#188) 2022-03-03 13:22:29 -08:00
McCall Saltzman 4894b939e0
Pick up built in functions left behind in the split (#181)
* Pick up built in functions left behind in the split

* Resources, and make lint happy

* pr feedback

* Nit

* Optionset impl

* Add isblankorerror impl, tests
2022-02-28 11:15:25 -08:00
McCall Saltzman 018ad7fb34
Add back a customizable EnumStore as a stopgap awaiting refactor (#182)
* Add back EnumStore as a stopgap awaiting refactor

* Move to builder

* Make lint happy

* private constructor + static

* lint

* remove unneeded change
2022-02-28 10:32:00 -08:00
McCall Saltzman 2e414e9c16
Remove Set/UpdateContext specific functions from TexlFunction base (#177) 2022-02-23 15:50:46 -08:00
bryancroteau-MSFT 67aa0e63bd
Add a new function to the binder to access string interpolation nodes (#176) 2022-02-23 14:30:36 -08:00
bryancroteau-MSFT 2a5f7f8675
Add new intellisense TokenType enum values for string interpolation (#175) 2022-02-23 11:10:31 -08:00
Robulane 0c3ee60eb2
Fix thread safety issue when engine was giving results for a wrong expression (#174)
* Fix thread safety issue when engine was giving results for a wrong expression

* Fix tests

* Improve the test
2022-02-23 09:28:12 -08:00
Mike Stall 41806cc6dc
add scenario test cases (#172)
Add test cases for Mutability and lazily marshalling objects. 
Fix some uncovered bugs in Index_UO.
2022-02-22 11:22:34 -08:00
Robulane f8a5880cda
Improve Suggest api performance (#169)
* Stop creating thousands of objects during AutoSugggest

* put private after internal

* Fix list builder
2022-02-18 09:37:06 -08:00
bryancroteau-MSFT e795a105ca
Add new unit tests for empty islands (#171)
* Add new unit tests for empty islands

* Add more tests for when a record is the last child
2022-02-17 16:22:03 -08:00
Luc Genetier fbfe39d48b
Fix EvalVisitor Neq (#170)
* Fix EvalVisitor Neq

* update project file

* Adding Time tests
2022-02-17 23:12:31 +01:00
Mike Stall bc04473309
Remove 2.1 from tests. This isn't supported anymore and tests don't r… (#165)
Remove 2.1 from tests. This isn't supported anymore and tests don't run if it isn't installed.
See  https://dotnet.microsoft.com/en-us/download/dotnet/2.1
Test still run against 3.1.

Nunit bug is that InlineData in strings need to have balanced quotes.
Update test case. This shouldn't lose coverage since the quote comes after the intellisense cursor.
2022-02-16 23:56:09 -08:00
McCall Saltzman 677c49f83d
Improve BaseRunner contract (#164) 2022-02-15 14:04:01 -08:00
McCall Saltzman f36c1ad872
Add Guid and Color FormulaTypes/Values (#161)
* Add Guid and Color FormulaTypes

* Add values

* BOM and public surface
2022-02-15 13:20:39 -08:00
bryancroteau-MSFT c58e863070
Remove the StringInterpolation IR node (#162) 2022-02-15 11:50:59 -08:00