Expand description
Rust support for KCL (aka the KittyCAD Language).
KCL is written in Rust. This crate contains the compiler tooling (e.g. parser, lexer, code generation), the standard library implementation, a LSP implementation, generator for the docs, and more.
Modules§
- exec
- lint
- mock_
engine - native_
engine - pretty
- std
- Functions implemented for language execution.
- std_
utils - test_
server - Types used to send data to the test server.
Structs§
- Compilation
Error - An error which occurred during parsing, etc.
- Configuration
- User specific settings for the app.
These live in
user.toml
in the app’s configuration directory. Updating the settings in the app will update this file automatically. Do not edit this file manually, as it may be overwritten by the app. Manual edits can cause corruption of the settings file. - Copilot
LspBackend - Engine
Stats - Exec
Outcome - Outcome of executing a program. This is used in TS.
- Exec
State - State for executing a program.
- Executor
Context - The executor context.
Cloning will return another handle to the same engine connection/session,
as this uses
Arc
under the hood. - Executor
Settings - The executor settings.
- Format
Options - Format options.
- KclError
With Outputs - KclLsp
Backend - The lsp server backend.
- KclLsp
Server SubCommand - A subcommand for running the server.
- Meta
Settings - Module
Id - Identifier of a source file. Uses a u32 to keep the size small.
- Point2d
- Program
- Project
Configuration - Project specific settings for the app.
These live in
project.toml
in the base of the project directory. Updating the settings for the project in the app will update this file automatically. Do not edit this file manually, as it may be overwritten by the app. Manual edits can cause corruption of the settings file. - Report
- Report
With Outputs - Source
Range - The first two items are the start and end points (byte offsets from the start of the file). The third item is whether the source range belongs to the ‘main’ file, i.e., the file currently being rendered/displayed in the editor.
Enums§
- Connection
Error - How did KCL client fail to connect to the engine
- Exec
Error - How did the KCL execution fail
- Execution
Kind - The mode of execution. When isolated, like during an import, attempting to send a command results in an error.
- KclError
- Unit
Length - The valid types of length units.
Traits§
Functions§
- bust_
cache - clear_
mem_ cache - modify_
ast_ for_ sketch - Update the AST to reflect the new state of the program after something like a move or a new line.
- recast_
dir - Recast all the kcl files in a directory, recursively.
- version
- Get the version of the KCL library.