* Replace tag type with tagIdent and tagDecl
Signed-off-by: Nick Cameron <nrc@ncameron.org>
* Replace tagIdent with TaggedEdge and TaggedFace
Signed-off-by: Nick Cameron <nrc@ncameron.org>
---------
Signed-off-by: Nick Cameron <nrc@ncameron.org>
* Improve docs around PI
Signed-off-by: Nick Cameron <nrc@ncameron.org>
* Refactor and polish type error messages
Signed-off-by: Nick Cameron <nrc@ncameron.org>
* Add suggestion to fix unknown numbers error
Signed-off-by: Nick Cameron <nrc@ncameron.org>
* Don't warn so often about unknown units
Signed-off-by: Nick Cameron <nrc@ncameron.org>
---------
Signed-off-by: Nick Cameron <nrc@ncameron.org>
* Replace uses of get_unlabeled_kw_arg with _typed version
Signed-off-by: Nick Cameron <nrc@ncameron.org>
* Remove more untyped arg getters
Signed-off-by: Nick Cameron <nrc@ncameron.org>
---------
Signed-off-by: Nick Cameron <nrc@ncameron.org>
* Add backtrace to errors
* Add display of backtraces with hints
* Change pane badge to only show count of errors
* Fix property name to not collide with Error superclass
* Increase min stack again
* Add e2e test that checks that the diagnostics are created in CodeMirror
* Remove unneeded code
* Change to the new hotness
Preparing for the removal of positional functions from the language. The first big step is to change all our KCL code examples, test code, public samples etc to all use keyword functions.
Apologies for how large this PR is. Most of it is:
- Changing example KCL that defined its own functions, so the functions now use keyword arguments rather than positional arguments. E.g. change `cube([20, 20])` to be `cube(center = [20, 20])`.
- Some parts of the code assumed positional code and didn't handle keyword calls, e.g. the linter would only check for positional calls to startSketchOn. Now they should work with either positional or keyword.
- Update all the artifacts
This does _not_ remove support for positional calls. That will be in a follow-up PR.
* Remove deprecated syntax
Signed-off-by: Nick Cameron <nrc@ncameron.org>
* fix one test
* fix sketch on revolved face test
* fix test: empty-scene default-planes act as expected
* fix up more tests
* another fix
* remove another const
---------
Signed-off-by: Nick Cameron <nrc@ncameron.org>
Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch>
* Declare chamfer in KCL
Signed-off-by: Nick Cameron <nrc@ncameron.org>
* Ignore more in the simulation tests
Signed-off-by: Nick Cameron <nrc@ncameron.org>
* Declare fillet in KCL
Signed-off-by: Nick Cameron <nrc@ncameron.org>
* Move shell and hollow to KCL
Signed-off-by: Nick Cameron <nrc@ncameron.org>
---------
Signed-off-by: Nick Cameron <nrc@ncameron.org>
* More units of measure work
Signed-off-by: Nick Cameron <nrc@ncameron.org>
* Update CSG output since engine change
---------
Signed-off-by: Nick Cameron <nrc@ncameron.org>
Co-authored-by: Nick Cameron <nrc@ncameron.org>
* Support calling KCL std KW fns, and move circle to KCL std
Signed-off-by: Nick Cameron <nrc@ncameron.org>
* Doc comments on parameters
Signed-off-by: Nick Cameron <nrc@ncameron.org>
* Update grammar
Signed-off-by: Nick Cameron <nrc@ncameron.org>
* Change use of counterClockWise to ccw
Signed-off-by: Nick Cameron <nrc@ncameron.org>
---------
Signed-off-by: Nick Cameron <nrc@ncameron.org>
* Support paths to names rather than just raw idents
Signed-off-by: Nick Cameron <nrc@ncameron.org>
* A snapshot a day keeps the bugs away! 📷🐛
* A snapshot a day keeps the bugs away! 📷🐛
* A snapshot a day keeps the bugs away! 📷🐛
* A snapshot a day keeps the bugs away! 📷🐛
---------
Signed-off-by: Nick Cameron <nrc@ncameron.org>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* Automatic fixing of deprecations and use non-quoted default planes by default
Signed-off-by: Nick Cameron <nrc@ncameron.org>
* A snapshot a day keeps the bugs away! 📷🐛
* A snapshot a day keeps the bugs away! 📷🐛
* A snapshot a day keeps the bugs away! 📷🐛
* A snapshot a day keeps the bugs away! 📷🐛
* A snapshot a day keeps the bugs away! 📷🐛
---------
Signed-off-by: Nick Cameron <nrc@ncameron.org>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* Parse [T] instead of T[] for array types
Signed-off-by: Nick Cameron <nrc@ncameron.org>
* homogenous arrays, type coercion, remove solid set and sketch set, etc
Signed-off-by: Nick Cameron <nrc@ncameron.org>
---------
Signed-off-by: Nick Cameron <nrc@ncameron.org>
* Add warning when using a module with no return value
* Update output files since changing source range of the pipeline argument
* Change wording of error message to not use the term unlabeled
Fixes https://github.com/KittyCAD/modeling-app/issues/4307
Now if you try to fillet the same edge twice in a single fillet command,
the error message is clearer, and the source range will highlight
the specific edges in the array which are duplicated.
Same goes for chamfer.
Note: although the Rust KCL interpreter sends back an array of SourceRange
for each KCL error, the frontend only puts the first one into CodeMirror
diagnostics. We should fix that: https://github.com/KittyCAD/modeling-app/issues/5754
Previous error message:
"Expected a kcl_lib::execution::geometry::SolidSet but found Sketch"
New error message:
"Expected a SolidSet but found Sketch. You can convert a sketch (2D) into a Solid (3D) by calling a function like `extrude` or `revolve`"
Two improvements:
- Don't print the fully-qualified Rust name (e.g. kcl_lib::executor::Solid) instead use the last part of that (e.g. just Solid)
- Allow specific suggestions for combinations of got/want (e.g. "You can convert a sketch (2D) into a Solid (3D) by calling a function like `extrude` or `revolve`")
Closes#5616
Previously, `xLine`, `xLineTo`, `yLine` and `yLineTo` used positional arguments. Now:
- `xLineTo` and `yLineTo` have been removed
- `xLine` and `yLine` both use keyword arguments:
- `length`, optional (i.e. a relative distance along the X or Y axis)
- `endAbsolute` optional (i.e. an absolute point along the X or Y axis)
- `tag` optional
- Exactly one of `length` or `endAbsolute` must be given. Not both, not neither.
For example:
```
// Old way
|> xLine(6.04, %)
|> yLineTo(20, %, $base)
// New way
|> xLine(length = 6.04)
|> yLine(endAbsolute = 20, tag = $base)
```
This also improves some of the general-purpose keyword arguments code in modeling app's TS codebase.
* add export test so we dont break cli / kcl.py
Signed-off-by: Jess Frazelle <github@jessfraz.com>
Overwrite created date (#5602)
* updates
Signed-off-by: Jess Frazelle <github@jessfraz.com>
---------
Signed-off-by: Jess Frazelle <github@jessfraz.com>